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:
p = external_posters[service][0]
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)
posters.append(p)
posters.sort(key=lambda a: a['index'])

View file

@ -49,12 +49,13 @@ def update_poster(itemId):
item = models.Item.objects.get(itemId=itemId)
item.make_poster(True)
item.make_icon()
models.Item.objects.filter(pk=item.id).update(
poster=item.poster.name,
poster_height=item.poster.height,
poster_width=item.poster.width,
icon=item.icon.name
)
if item.poster and os.path.exists(item.poster.path):
models.Item.objects.filter(pk=item.id).update(
poster=item.poster.name,
poster_height=item.poster.height,
poster_width=item.poster.width,
icon=item.icon.name
)
@task(ignore_results=True, queue='default')
def update_file_paths(itemId):