parent
b70a3331e0
commit
f8bfb981ef
1 changed files with 10 additions and 6 deletions
|
@ -290,16 +290,19 @@ class PlaybackUtils():
|
||||||
self.currentPosition = 0
|
self.currentPosition = 0
|
||||||
for item in self.xml:
|
for item in self.xml:
|
||||||
api = API(item)
|
api = API(item)
|
||||||
|
successful = True
|
||||||
if api.getType() == v.PLEX_TYPE_CLIP:
|
if api.getType() == v.PLEX_TYPE_CLIP:
|
||||||
self.add_trailer(item)
|
self.add_trailer(item)
|
||||||
else:
|
else:
|
||||||
with Get_Plex_DB() as plex_db:
|
with Get_Plex_DB() as plex_db:
|
||||||
db_item = plex_db.getItem_byId(api.getRatingKey())
|
db_item = plex_db.getItem_byId(api.getRatingKey())
|
||||||
if db_item is not None:
|
if db_item is not None:
|
||||||
if add_item_to_kodi_playlist(self.playqueue,
|
successful = add_item_to_kodi_playlist(
|
||||||
self.currentPosition,
|
self.playqueue,
|
||||||
kodi_id=db_item[0],
|
self.currentPosition,
|
||||||
kodi_type=db_item[4]) is True:
|
kodi_id=db_item[0],
|
||||||
|
kodi_type=db_item[4])
|
||||||
|
if successful is True:
|
||||||
self.currentPosition += 1
|
self.currentPosition += 1
|
||||||
if len(item[0]) > 1:
|
if len(item[0]) > 1:
|
||||||
self.add_part(item,
|
self.add_part(item,
|
||||||
|
@ -309,8 +312,9 @@ class PlaybackUtils():
|
||||||
else:
|
else:
|
||||||
# Item not in Kodi DB
|
# Item not in Kodi DB
|
||||||
self.add_trailer(item)
|
self.add_trailer(item)
|
||||||
self.playqueue.items[self.currentPosition - 1].ID = item.get(
|
if successful is True:
|
||||||
'%sItemID' % self.playqueue.kind)
|
self.playqueue.items[self.currentPosition - 1].ID = item.get(
|
||||||
|
'%sItemID' % self.playqueue.kind)
|
||||||
|
|
||||||
def add_trailer(self, item):
|
def add_trailer(self, item):
|
||||||
# Playurl needs to point back so we can get metadata!
|
# Playurl needs to point back so we can get metadata!
|
||||||
|
|
Loading…
Reference in a new issue