From 01ace414cb382ac234d900132b2cc27c37b8d0b5 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 11 Nov 2014 11:50:09 +0100 Subject: [PATCH] normalize values --- oxdata/movie/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/oxdata/movie/models.py b/oxdata/movie/models.py index a419432..de28a57 100644 --- a/oxdata/movie/models.py +++ b/oxdata/movie/models.py @@ -50,7 +50,7 @@ def find(info, guess=True): return m #For now fallback to ox.web.imdb.guess and try again if guess and 'title' in info: - id = ox.web.imdb.get_movie_id(info['title']) + id = ox.web.imdb.get_movie_id(normalize_value(info['title'])) if id: i, created = Imdb.objects.get_or_create(imdb=id) if created: @@ -270,9 +270,9 @@ class Match(models.Model): @classmethod def get_keys(cls, data): data = { - 'title': data['title'].lower(), + 'title': normalize_value(data['title'].lower()), 'year': str(data.get('year', '')), - 'director': ';'.join(sorted(data.get('director', []))) + 'director': normalize_value(';'.join(sorted(data.get('director', [])))) } keys = [] if not data['director']: