refactored
This commit is contained in:
7
addon.py
7
addon.py
@@ -54,19 +54,18 @@ def conduct_program(program_file, feature):
|
||||
entry = {'type': 'video', 'data': location}
|
||||
program.append(entry)
|
||||
elif settings['source'] == 'tmdbtrailer':
|
||||
TMDB = tmdb.Tmdb(apikey = settings['apikey'])
|
||||
TMDB = tmdb.Tmdb(apikey = settings['apikey'], language = settings['language'])
|
||||
tmdbid = int(feature['tmdbid'])
|
||||
imdbid = feature['imdbid']
|
||||
language = settings['language']
|
||||
choice = settings['choice']
|
||||
trailertype = settings['type']
|
||||
count = settings['count']
|
||||
if not tmdbid:
|
||||
tmdbid = TMDB.get_tmdbid(imdbid)
|
||||
if tmdbid:
|
||||
movies = TMDB.get_recommendations(tmdbid, language, choice)
|
||||
movies = TMDB.get_recommendations(tmdbid, choice)
|
||||
random.shuffle(movies)
|
||||
trailers = TMDB.get_trailers(movies, language, trailertype, count)
|
||||
trailers = TMDB.get_trailers(movies, trailertype, count)
|
||||
else:
|
||||
print("TODO: this feature has no tmdb id, find someting else to play")
|
||||
trailers = []
|
||||
|
Reference in New Issue
Block a user