keep poster service selection even if poster gets updated, fixes #1098

This commit is contained in:
j 2013-07-13 13:04:59 +00:00
parent 2473dfd231
commit f0b8824f62
2 changed files with 8 additions and 7 deletions

View file

@ -463,7 +463,7 @@ class Item(models.Model):
for service in external_posters: for service in external_posters:
p = external_posters[service][0] p = external_posters[service][0]
p['source'] = service p['source'] = service
p['selected'] = p['url'] == url p['selected'] = self.poster_source and self.poster_source == service or False
p['index'] = index.index(service) p['index'] = index.index(service)
posters.append(p) posters.append(p)
posters.sort(key=lambda a: a['index']) posters.sort(key=lambda a: a['index'])

View file

@ -49,6 +49,7 @@ def update_poster(itemId):
item = models.Item.objects.get(itemId=itemId) item = models.Item.objects.get(itemId=itemId)
item.make_poster(True) item.make_poster(True)
item.make_icon() item.make_icon()
if item.poster and os.path.exists(item.poster.path):
models.Item.objects.filter(pk=item.id).update( models.Item.objects.filter(pk=item.id).update(
poster=item.poster.name, poster=item.poster.name,
poster_height=item.poster.height, poster_height=item.poster.height,