|
|
@ -61,7 +61,7 @@ class TheMovieDb(MovieProvider): |
|
|
|
|
|
|
|
return results |
|
|
|
|
|
|
|
def getInfo(self, identifier = None): |
|
|
|
def getInfo(self, identifier = None, extended = True): |
|
|
|
|
|
|
|
if not identifier: |
|
|
|
return {} |
|
|
@ -73,14 +73,14 @@ class TheMovieDb(MovieProvider): |
|
|
|
try: |
|
|
|
log.debug('Getting info: %s', cache_key) |
|
|
|
movie = tmdb3.Movie(identifier) |
|
|
|
result = self.parseMovie(movie) |
|
|
|
result = self.parseMovie(movie, with_actors = extended) |
|
|
|
self.setCache(cache_key, result) |
|
|
|
except: |
|
|
|
pass |
|
|
|
|
|
|
|
return result |
|
|
|
|
|
|
|
def parseMovie(self, movie, with_titles = True): |
|
|
|
def parseMovie(self, movie, with_titles = True, with_actors = True): |
|
|
|
|
|
|
|
cache_key = 'tmdb.cache.%s' % movie.id |
|
|
|
movie_data = self.getCache(cache_key) |
|
|
@ -112,12 +112,13 @@ class TheMovieDb(MovieProvider): |
|
|
|
|
|
|
|
# Gather actors data |
|
|
|
actors = {} |
|
|
|
for cast_item in movie.cast: |
|
|
|
try: |
|
|
|
actors[toUnicode(cast_item.name)] = toUnicode(cast_item.character) |
|
|
|
images['actor %s' % toUnicode(cast_item.name)] = self.getImage(cast_item, type = 'profile', size = 'original') |
|
|
|
except: |
|
|
|
log.debug('Error getting cast info for %s: %s', (cast_item, traceback.format_exc())) |
|
|
|
if with_actors: |
|
|
|
for cast_item in movie.cast: |
|
|
|
try: |
|
|
|
actors[toUnicode(cast_item.name)] = toUnicode(cast_item.character) |
|
|
|
images['actor %s' % toUnicode(cast_item.name)] = self.getImage(cast_item, type = 'profile', size = 'original') |
|
|
|
except: |
|
|
|
log.debug('Error getting cast info for %s: %s', (cast_item, traceback.format_exc())) |
|
|
|
|
|
|
|
movie_data = { |
|
|
|
'type': 'movie', |
|
|
|