]> git.0d.be Git - earwig.git/commitdiff
grab sound description from feed
authorFrédéric Péters <fpeters@0d.be>
Sun, 2 Sep 2018 07:34:23 +0000 (09:34 +0200)
committerFrédéric Péters <fpeters@0d.be>
Sun, 2 Sep 2018 10:12:23 +0000 (12:12 +0200)
earwig/sounds/sources.py

index a296f0c94ee32e23f5a668b33c8ec7845f18ef80..11856d008f74e79222ecdd04add56ffbd68e4cc1 100644 (file)
@@ -59,6 +59,9 @@ class Rss(object):
                 sound.page_url = entry.link
                 sound.channel = self.channel
                 sound.file_type = link.type
+                sound.image_url = entry.image.href if hasattr(entry, 'image') and entry.image.href else None
+                assert entry.description_detail.get('type') == 'text/html'
+                sound.description = entry.description_detail['value']
                 sound.original_publication_date = make_aware(datetime.datetime(*entry.published_parsed[:6]))
                 link_length = int(link.length) if link.length else None
                 if link_length != sound.file_size: