imdb ids can be longer

This commit is contained in:
j 2019-07-23 16:29:23 +02:00
parent f142a1a70d
commit 63809c2f48
2 changed files with 2 additions and 2 deletions

View file

@ -53,7 +53,7 @@ def find(info, guess=True):
q = Imdb.objects.all()
if 'id' in info:
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.save()
q = Imdb.objects.filter(imdb=info['id'])

View file

@ -29,7 +29,7 @@ def getData(request, data):
id = data['id']
if isinstance(id, int):
id = str(id)
if len(id) == 7:
if len(id) >= 7 and id.isdigit():
i, created = models.Imdb.objects.get_or_create(imdb=id)
if created:
i.update()