Add image support

This commit is contained in:
Oleg Lavrovsky 2017-07-03 17:56:40 +02:00
parent 616a33bc9b
commit e805e16fca

View file

@ -58,7 +58,11 @@ class Entry(models.Model):
if len(raw['alternate']) > 0: if len(raw['alternate']) > 0:
self.link = raw['alternate'][0]['href'] self.link = raw['alternate'][0]['href']
if 'visual' in raw and 'url' in raw['visual']:
if 'enclosure' in raw and len(raw['enclosure']) > 0:
if 'href' in raw['enclosure'][0]:
self.visual = raw['enclosure'][0]['href']
elif 'visual' in raw and 'url' in raw['visual']:
self.visual = raw['visual']['url'] self.visual = raw['visual']['url']
self._buildContent() self._buildContent()