import imdb if required
This commit is contained in:
parent
d780e12a80
commit
3cf265e461
2 changed files with 5 additions and 3 deletions
|
@ -14,12 +14,12 @@ def get_movie_id(request):
|
||||||
if 'movieId' in request.GET:
|
if 'movieId' in request.GET:
|
||||||
movieId = request.GET['movieId']
|
movieId = request.GET['movieId']
|
||||||
if len(movieId) == 7:
|
if len(movieId) == 7:
|
||||||
movie_id = models.MovieId.objects.get(imdb_id=movieId)
|
movie_id = models.getMovieIdByImdbId(imdb_id=movieId)
|
||||||
else:
|
else:
|
||||||
movie_id = models.MovieId.objects.get(oxdb_id=movieId)
|
movie_id = models.MovieId.objects.get(oxdb_id=movieId)
|
||||||
if 'imdb' in request.GET:
|
if 'imdb' in request.GET:
|
||||||
imdbId = request.GET['imdb']
|
movieId = request.GET['imdb']
|
||||||
movie_id = models.MovieId.objects.get(imdb_id=imdbId)
|
movie_id = models.getMovieIdByImdbId(imdb_id=movieId)
|
||||||
elif 'oxdb' in request.GET:
|
elif 'oxdb' in request.GET:
|
||||||
oxdbId = request.GET['oxdb']
|
oxdbId = request.GET['oxdb']
|
||||||
movie_id = models.MovieId.objects.get(oxdb_id=oxdbId)
|
movie_id = models.MovieId.objects.get(oxdb_id=oxdbId)
|
||||||
|
|
|
@ -17,6 +17,8 @@ import ox.web.impawards
|
||||||
from oxdata.lookup.models import MovieId
|
from oxdata.lookup.models import MovieId
|
||||||
|
|
||||||
def getPosters(movie_id, url_prefix='', limit=lambda x, y: x<y):
|
def getPosters(movie_id, url_prefix='', limit=lambda x, y: x<y):
|
||||||
|
if not movie_id:
|
||||||
|
return {}
|
||||||
getPosterUrls(movie_id)
|
getPosterUrls(movie_id)
|
||||||
posters = {}
|
posters = {}
|
||||||
if url_prefix.endswith('/'): url_prefix = url_prefix[:-1]
|
if url_prefix.endswith('/'): url_prefix = url_prefix[:-1]
|
||||||
|
|
Loading…
Reference in a new issue