]> git.0d.be Git - panikweb-esperanzah.git/commitdiff
include emission title (or panik itself) as itunes:author
authorFrédéric Péters <fpeters@0d.be>
Mon, 9 Sep 2019 19:01:47 +0000 (21:01 +0200)
committerFrédéric Péters <fpeters@0d.be>
Mon, 6 Jan 2020 12:50:21 +0000 (13:50 +0100)
panikweb/views.py

index b22d9f531f8e47f24429182b59a433b7ef8b5aba..069a4ac858f61ce41051b51895a19312ae2c0c33 100644 (file)
@@ -731,8 +731,16 @@ class RssCustomPodcastsFeed(Rss201rev2Feed):
         handler.addQuickElement('url', image_url)
         handler.endElement('image')
         handler.addQuickElement('itunes:image', None, {'href': image_url})
-        if emission and emission.subtitle:
-            handler.addQuickElement('itunes:subtitle', emission.subtitle)
+        if emission:
+            if emission.subtitle:
+                handler.addQuickElement('itunes:subtitle', emission.subtitle)
+            if emission.title:
+                handler.addQuickElement('itunes:author', emission.title)
+            else:
+                handler.addQuickElement('itunes:author', 'Radio Esperanzah!')
+            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()