cover url can fail

This commit is contained in:
j 2015-12-11 00:43:56 +00:00
parent fe7769a7ba
commit 5024414ed6

View file

@ -321,7 +321,11 @@ class Item(db.Model):
key = 'cover:%s'%self.id
cover = None
if 'cover' in self.meta and self.meta['cover']:
try:
cover = ox.cache.read_url(self.meta['cover'])
except:
logger.debug('unable to read cover url %s', self.meta['cover'])
cover = None
if cover:
icons[key] = cover
self.info['coverRatio'] = get_ratio(cover)