]> git.0d.be Git - panikweb.git/blobdiff - panikweb/views.py
include emission title (or panik itself) as itunes:author
[panikweb.git] / 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()