import imdb if required

This commit is contained in:
j 2010-09-17 10:39:24 +02:00
parent d780e12a80
commit 3cf265e461
2 changed files with 5 additions and 3 deletions

View file

@ -14,12 +14,12 @@ def get_movie_id(request):
if 'movieId' in request.GET:
movieId = request.GET['movieId']
if len(movieId) == 7:
movie_id = models.MovieId.objects.get(imdb_id=movieId)
movie_id = models.getMovieIdByImdbId(imdb_id=movieId)
else:
movie_id = models.MovieId.objects.get(oxdb_id=movieId)
if 'imdb' in request.GET:
imdbId = request.GET['imdb']
movie_id = models.MovieId.objects.get(imdb_id=imdbId)
movieId = request.GET['imdb']
movie_id = models.getMovieIdByImdbId(imdb_id=movieId)
elif 'oxdb' in request.GET:
oxdbId = request.GET['oxdb']
movie_id = models.MovieId.objects.get(oxdb_id=oxdbId)

View file

@ -17,6 +17,8 @@ import ox.web.impawards
from oxdata.lookup.models import MovieId
def getPosters(movie_id, url_prefix='', limit=lambda x, y: x<y):
if not movie_id:
return {}
getPosterUrls(movie_id)
posters = {}
if url_prefix.endswith('/'): url_prefix = url_prefix[:-1]