diff --git a/oxdata/movie/models.py b/oxdata/movie/models.py index 3a7ba2e..e5f6ba6 100644 --- a/oxdata/movie/models.py +++ b/oxdata/movie/models.py @@ -7,7 +7,7 @@ from django.db import models import ox -def find(info): +def find(info, guess=True): q = Imdb.objects.all() for key in Imdb.keys: if key in info and info[key]: @@ -21,6 +21,14 @@ def find(info): q = q.filter(**{fkey:info[key]}) if q.count() == 1: return q[0] + #For now fallback to ox.web.imdb.guess and try again + if guess: + id = ox.web.imdb.getMovieId(info['title']) + if id: + i, created = Imdb.objects.get_or_create(imdb=id) + if created: + i.update() + return find(info, False) return None class Imdb(models.Model): diff --git a/oxdata/templates/500.html b/oxdata/templates/500.html new file mode 100644 index 0000000..0ee00ad --- /dev/null +++ b/oxdata/templates/500.html @@ -0,0 +1 @@ +500 error