added rating to playlist

This commit is contained in:
Ronald Schaten 2021-03-16 19:59:30 +01:00
parent a57e2234a0
commit 9f40ff2c96

View File

@ -113,6 +113,20 @@ def conduct_program(program_file, feature):
for trailer in trailers:
entry = {'type': 'video', 'data': trailer['location']}
program.append(entry)
elif settings['source'] == 'rating':
rating = -1
for s in feature['mpaa'].split():
if s.isdigit():
rating = int(s)
break
if rating > -1:
dirs, files = xbmcvfs.listdir(settings['location'])
for f in files:
if f.startswith(str(rating)+'.'):
location = settings['location'] + f
break
entry = {'type': 'video', 'data': location}
program.append(entry)
elif settings['source'] == 'feature':
entry = {'type': 'video', 'data': feature['file']}
program.append(entry)