diff --git a/pandora/item/models.py b/pandora/item/models.py index 508a51f26..80fc049ad 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -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']) diff --git a/pandora/item/tasks.py b/pandora/item/tasks.py index f10f06128..291b166c9 100644 --- a/pandora/item/tasks.py +++ b/pandora/item/tasks.py @@ -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):