imdb ids can be longer
This commit is contained in:
parent
f142a1a70d
commit
63809c2f48
2 changed files with 2 additions and 2 deletions
|
@ -53,7 +53,7 @@ def find(info, guess=True):
|
||||||
q = Imdb.objects.all()
|
q = Imdb.objects.all()
|
||||||
if 'id' in info:
|
if 'id' in info:
|
||||||
q = q.filter(imdb=info['id'])
|
q = q.filter(imdb=info['id'])
|
||||||
if q.count() == 0 and len(info['id']) == 7:
|
if q.count() == 0 and len(info['id']) >= 7 and str(info['id']).isdigit():
|
||||||
i = Imdb(imdb=info['id'])
|
i = Imdb(imdb=info['id'])
|
||||||
i.save()
|
i.save()
|
||||||
q = Imdb.objects.filter(imdb=info['id'])
|
q = Imdb.objects.filter(imdb=info['id'])
|
||||||
|
|
|
@ -29,7 +29,7 @@ def getData(request, data):
|
||||||
id = data['id']
|
id = data['id']
|
||||||
if isinstance(id, int):
|
if isinstance(id, int):
|
||||||
id = str(id)
|
id = str(id)
|
||||||
if len(id) == 7:
|
if len(id) >= 7 and id.isdigit():
|
||||||
i, created = models.Imdb.objects.get_or_create(imdb=id)
|
i, created = models.Imdb.objects.get_or_create(imdb=id)
|
||||||
if created:
|
if created:
|
||||||
i.update()
|
i.update()
|
||||||
|
|
Loading…
Reference in a new issue