return latest poster first, fixes #1561

This commit is contained in:
j 2013-06-02 12:48:02 +02:00
parent e7a36d533b
commit 226c4fb2c0

View file

@ -29,7 +29,7 @@ def getPosters(movie_id, url_prefix='', limit=lambda x, y: 0.3 < x/y < 1):
get_poster_urls(movie_id) get_poster_urls(movie_id)
posters = {} posters = {}
if url_prefix.endswith('/'): url_prefix = url_prefix[:-1] if url_prefix.endswith('/'): url_prefix = url_prefix[:-1]
for p in PosterCache.objects.all().filter(movie_id=movie_id, failed=False).order_by('id'): for p in PosterCache.objects.all().filter(movie_id=movie_id, failed=False).order_by('-id'):
if p.site not in posters: if p.site not in posters:
posters[p.site] = [] posters[p.site] = []
poster = p.get() poster = p.get()