diff --git a/pandora/archive/views.py b/pandora/archive/views.py index 72e35e3..c5f0c95 100644 --- a/pandora/archive/views.py +++ b/pandora/archive/views.py @@ -243,6 +243,11 @@ def moveFiles(request): else: if len(data['itemId']) != 7: del data['itemId'] + if 'director' in data and isinstance(data['director'], basestring): + if data['director'] == '': + data['director'] = [] + else: + data['director'] = data['director'].split(', ') i = get_item(data) else: i = get_item({'imdbId': data['itemId']}) diff --git a/pandora/item/models.py b/pandora/item/models.py index 4853cf7..62afbb7 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -61,7 +61,10 @@ def get_item(info, user=None): q = Item.objects.all() for key in ('title', 'director', 'year'): if key in info and info[key]: - q = q.filter(find__key=key, find__value=info[key]) + if isinstance(info[key], list): + q = q.filter(find__key=key, find__value='\n'.join(info[key])) + else: + q = q.filter(find__key=key, find__value=info[key]) if q.count() >= 1: item = q[0] elif not 'oxdbId' in info: