use new default poster, remove black posters from icon cache
This commit is contained in:
parent
fbf06a1545
commit
59a3709f84
6 changed files with 61 additions and 32 deletions
|
|
@ -362,18 +362,21 @@ class Item(db.Model):
|
|||
icons[key] = cover
|
||||
self.info['coverRatio'] = get_ratio(cover)
|
||||
else:
|
||||
if icons[key]:
|
||||
del icons[key]
|
||||
path = self.get_path()
|
||||
del icons[key]
|
||||
key = 'preview:%s'%self.id
|
||||
if path:
|
||||
preview = self.extract_preview()
|
||||
if preview:
|
||||
icons[key] = preview
|
||||
self.info['previewRatio'] = get_ratio(preview)
|
||||
if not cover:
|
||||
self.info['coverRatio'] = self.info['previewRatio']
|
||||
elif cover:
|
||||
preview = self.extract_preview()
|
||||
if preview:
|
||||
icons[key] = preview
|
||||
self.info['previewRatio'] = get_ratio(preview)
|
||||
if not cover:
|
||||
self.info['coverRatio'] = self.info['previewRatio']
|
||||
else:
|
||||
del icons[key]
|
||||
if 'previewRatio' in self.info:
|
||||
del self.info['previewRatio']
|
||||
if not cover and 'coverRatio' in self.info:
|
||||
del self.info['coverRatio']
|
||||
if cover and not preview:
|
||||
self.info['previewRatio'] = self.info['coverRatio']
|
||||
for key in ('cover', 'preview'):
|
||||
key = '%s:%s' % (key, self.id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue