refactored

This commit is contained in:
2021-03-19 13:54:04 +01:00
parent d9e185ba4f
commit 5e238ba9b0
2 changed files with 17 additions and 17 deletions

View File

@@ -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 = []