fix(feeds): torznab newznab category parsing (#775)

This commit is contained in:
ze0s 2023-03-19 23:35:33 +01:00 committed by GitHub
parent 0d6e23f278
commit 81d494ec5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 12 deletions

View file

@ -18,13 +18,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"`
}
@ -63,7 +63,7 @@ type Enclosure struct {
Type string `xml:"type,attr"`
}
func (f FeedItem) MapCategoriesFromAttr() {
func (f *FeedItem) MapCategoriesFromAttr() {
for _, attr := range f.Attributes {
if attr.Name == "category" {
catId, err := strconv.Atoi(attr.Value)
@ -82,7 +82,7 @@ func (f FeedItem) MapCategoriesFromAttr() {
}
}
func (f FeedItem) MapCustomCategoriesFromAttr(categories []Category) {
func (f *FeedItem) MapCustomCategoriesFromAttr(categories []Category) {
for _, attr := range f.Attributes {
if attr.Name == "category" {
catId, err := strconv.Atoi(attr.Value)