forked from 0x2620/pandora
dont call item.save() in poster update, this causes data loss
This commit is contained in:
parent
558306a629
commit
931aeaf130
3 changed files with 5 additions and 2 deletions
|
@ -289,6 +289,7 @@ def moveFiles(request):
|
||||||
if Item.objects.filter(itemId=data['itemId']).count() == 1:
|
if Item.objects.filter(itemId=data['itemId']).count() == 1:
|
||||||
i = Item.objects.get(itemId=data['itemId'])
|
i = Item.objects.get(itemId=data['itemId'])
|
||||||
else:
|
else:
|
||||||
|
data['itemId'] = data['itemId'].strip()
|
||||||
if len(data['itemId']) != 7:
|
if len(data['itemId']) != 7:
|
||||||
del data['itemId']
|
del data['itemId']
|
||||||
if 'director' in data and isinstance(data['director'], basestring):
|
if 'director' in data and isinstance(data['director'], basestring):
|
||||||
|
|
|
@ -105,7 +105,6 @@ def get_item(info, user=None, async=False):
|
||||||
info['imdbId'] = itemId
|
info['imdbId'] = itemId
|
||||||
item = get_item(info)
|
item = get_item(info)
|
||||||
return item
|
return item
|
||||||
|
|
||||||
try:
|
try:
|
||||||
item = Item.objects.get(itemId=info.get('oxdbId'))
|
item = Item.objects.get(itemId=info.get('oxdbId'))
|
||||||
except Item.DoesNotExist:
|
except Item.DoesNotExist:
|
||||||
|
|
|
@ -43,7 +43,10 @@ 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()
|
||||||
item.save()
|
models.Item.objects.filter(pk=item.id).update(
|
||||||
|
poster=item.poster.name,
|
||||||
|
icon=item.icon.name
|
||||||
|
)
|
||||||
|
|
||||||
@task(ignore_resulsts=True, queue='default')
|
@task(ignore_resulsts=True, queue='default')
|
||||||
def update_external(itemId):
|
def update_external(itemId):
|
||||||
|
|
Loading…
Reference in a new issue