diff --git a/pandora/archive/views.py b/pandora/archive/views.py index 27c341721..6efbfe9c9 100644 --- a/pandora/archive/views.py +++ b/pandora/archive/views.py @@ -289,6 +289,7 @@ def moveFiles(request): if Item.objects.filter(itemId=data['itemId']).count() == 1: i = Item.objects.get(itemId=data['itemId']) else: + data['itemId'] = data['itemId'].strip() if len(data['itemId']) != 7: del data['itemId'] if 'director' in data and isinstance(data['director'], basestring): diff --git a/pandora/item/models.py b/pandora/item/models.py index b893b20b6..c7c6af198 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -105,7 +105,6 @@ def get_item(info, user=None, async=False): info['imdbId'] = itemId item = get_item(info) return item - try: item = Item.objects.get(itemId=info.get('oxdbId')) except Item.DoesNotExist: diff --git a/pandora/item/tasks.py b/pandora/item/tasks.py index 273d24cdf..61fc43da2 100644 --- a/pandora/item/tasks.py +++ b/pandora/item/tasks.py @@ -43,7 +43,10 @@ def update_poster(itemId): item = models.Item.objects.get(itemId=itemId) item.make_poster(True) item.make_icon() - item.save() + models.Item.objects.filter(pk=item.id).update( + poster=item.poster.name, + icon=item.icon.name + ) @task(ignore_resulsts=True, queue='default') def update_external(itemId):