]> git.0d.be Git - panikweb.git/commitdiff
add itunes:category tag to podcast feeds
authorFrédéric Péters <fpeters@0d.be>
Sun, 8 Sep 2019 19:18:21 +0000 (21:18 +0200)
committerFrédéric Péters <fpeters@0d.be>
Sun, 8 Sep 2019 19:18:21 +0000 (21:18 +0200)
panikweb/views.py

index 42fca09b1f450765491c1c148f91680463597647..f0490cf9ccd36cb1c3d19fa7949d5dcf0dc96b16 100644 (file)
@@ -680,6 +680,10 @@ class RssCustomPodcastsFeed(Rss201rev2Feed):
         handler.addQuickElement('itunes:image', None, {'href': image_url})
         if emission and emission.subtitle:
             handler.addQuickElement('itunes:subtitle', emission.subtitle)
+        if emission:
+            for category in emission.categories.all():
+                if category.itunes_category:
+                    handler.addQuickElement('itunes:category', None, {'text': category.itunes_category})
 
     def root_attributes(self):
         attrs = super(RssCustomPodcastsFeed, self).root_attributes()