mirror of
https://github.com/miniflux/v2.git
synced 2025-08-01 17:38:37 +00:00
Parse podcast categories
This commit is contained in:
parent
f8e50947f2
commit
6d97f8b458
3 changed files with 113 additions and 40 deletions
|
@ -22,6 +22,17 @@ type ItunesFeedElement struct {
|
|||
ItunesType string `xml:"http://www.itunes.com/dtds/podcast-1.0.dtd type"`
|
||||
}
|
||||
|
||||
func (i *ItunesFeedElement) GetItunesCategories() []string {
|
||||
var categories []string
|
||||
for _, category := range i.ItunesCategories {
|
||||
categories = append(categories, category.Text)
|
||||
if category.SubCategory != nil {
|
||||
categories = append(categories, category.SubCategory.Text)
|
||||
}
|
||||
}
|
||||
return categories
|
||||
}
|
||||
|
||||
type ItunesItemElement struct {
|
||||
ItunesAuthor string `xml:"http://www.itunes.com/dtds/podcast-1.0.dtd author"`
|
||||
ItunesEpisode string `xml:"http://www.itunes.com/dtds/podcast-1.0.dtd episode"`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue