added rating to playlist
This commit is contained in:
parent
a57e2234a0
commit
9f40ff2c96
14
addon.py
14
addon.py
@ -113,6 +113,20 @@ def conduct_program(program_file, feature):
|
|||||||
for trailer in trailers:
|
for trailer in trailers:
|
||||||
entry = {'type': 'video', 'data': trailer['location']}
|
entry = {'type': 'video', 'data': trailer['location']}
|
||||||
program.append(entry)
|
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':
|
elif settings['source'] == 'feature':
|
||||||
entry = {'type': 'video', 'data': feature['file']}
|
entry = {'type': 'video', 'data': feature['file']}
|
||||||
program.append(entry)
|
program.append(entry)
|
||||||
|
Loading…
Reference in New Issue
Block a user