mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 00:39:13 +00:00
fix(feeds): torznab newznab category parsing (#775)
This commit is contained in:
parent
0d6e23f278
commit
81d494ec5c
5 changed files with 12 additions and 12 deletions
|
@ -17,13 +17,13 @@ func (f Feed) Len() int {
|
|||
}
|
||||
|
||||
type Channel struct {
|
||||
Title string `xml:"title"`
|
||||
Items []FeedItem `xml:"item"`
|
||||
Title string `xml:"title"`
|
||||
Items []*FeedItem `xml:"item"`
|
||||
}
|
||||
|
||||
type Response struct {
|
||||
Channel struct {
|
||||
Items []FeedItem `xml:"item"`
|
||||
Items []*FeedItem `xml:"item"`
|
||||
} `xml:"channel"`
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ type ItemAttr struct {
|
|||
Value string `xml:"value,attr"`
|
||||
}
|
||||
|
||||
func (f FeedItem) MapCategories(categories []Category) {
|
||||
func (f *FeedItem) MapCategories(categories []Category) {
|
||||
for _, category := range f.Category {
|
||||
// less than 10000 it's default categories
|
||||
if category < 10000 {
|
||||
|
|
|
@ -241,7 +241,7 @@ func (c *client) GetCaps() *Caps {
|
|||
return c.Capabilities
|
||||
}
|
||||
|
||||
func (c *client) Search(ctx context.Context, query string) ([]FeedItem, error) {
|
||||
func (c *client) Search(ctx context.Context, query string) ([]*FeedItem, error) {
|
||||
v := url.Values{}
|
||||
v.Add("q", query)
|
||||
params := v.Encode()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue