handle feature without TMDB id
This commit is contained in:
parent
aa6f35b4de
commit
a57e2234a0
6
addon.py
6
addon.py
@ -103,9 +103,13 @@ def conduct_program(program_file, feature):
|
||||
choice = settings['choice']
|
||||
trailertype = settings['type']
|
||||
count = settings['count']
|
||||
if tmdbid:
|
||||
movies = get_recommendations(apikey, tmdbid, language, choice)
|
||||
random.shuffle(movies)
|
||||
trailers = get_trailers(apikey, movies, language, trailertype, count)
|
||||
else:
|
||||
print("TODO: this feature has no tmdb id, find someting else to play")
|
||||
trailers = []
|
||||
for trailer in trailers:
|
||||
entry = {'type': 'video', 'data': trailer['location']}
|
||||
program.append(entry)
|
||||
@ -118,6 +122,8 @@ def get_feature(movieid):
|
||||
query = '{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovieDetails", "params": {"movieid": %s, "properties": ["file", "mpaa", "uniqueid"]}, "id": "1"}' % movieid
|
||||
json_response = xbmc.executeJSONRPC(query)
|
||||
response = json.loads(json_response)
|
||||
if not 'tmdb' in response['result']['moviedetails']['uniqueid']:
|
||||
response['result']['moviedetails']['uniqueid']['tmdb'] = 0
|
||||
feature = {
|
||||
'label': response['result']['moviedetails']['label'],
|
||||
'file': response['result']['moviedetails']['file'],
|
||||
|
Loading…
Reference in New Issue
Block a user