Move PKC playlist shortcut
This commit is contained in:
parent
ce30a3f03f
commit
5eafcbafb1
3 changed files with 12 additions and 19 deletions
|
@ -137,7 +137,7 @@ class Main():
|
||||||
entrypoint.get_video_files(plexId, params)
|
entrypoint.get_video_files(plexId, params)
|
||||||
|
|
||||||
elif mode == 'playlists':
|
elif mode == 'playlists':
|
||||||
entrypoint.playlists(params.get('type'))
|
entrypoint.playlists(params.get('content_type'))
|
||||||
|
|
||||||
elif mode == 'hub':
|
elif mode == 'hub':
|
||||||
entrypoint.hub(params.get('type'))
|
entrypoint.hub(params.get('type'))
|
||||||
|
|
|
@ -152,6 +152,11 @@ def show_main_menu(content_type=None):
|
||||||
'homevideos',
|
'homevideos',
|
||||||
'musicvideos') and content_type == 'video':
|
'musicvideos') and content_type == 'video':
|
||||||
directory_item(label, path)
|
directory_item(label, path)
|
||||||
|
# Playlists
|
||||||
|
if content_type != 'image':
|
||||||
|
directory_item(utils.lang(136),
|
||||||
|
('plugin://%s?mode=playlists&content_type=%s'
|
||||||
|
% (v.ADDON_ID, content_type)))
|
||||||
# Plex Hub
|
# Plex Hub
|
||||||
directory_item('Plex Hub',
|
directory_item('Plex Hub',
|
||||||
'plugin://%s?mode=hub&type=%s' % (v.ADDON_ID, content_type))
|
'plugin://%s?mode=hub&type=%s' % (v.ADDON_ID, content_type))
|
||||||
|
@ -676,11 +681,12 @@ def on_deck_episodes(viewid, tagname, limit):
|
||||||
xbmcplugin.endOfDirectory(handle=int(argv[1]))
|
xbmcplugin.endOfDirectory(handle=int(argv[1]))
|
||||||
|
|
||||||
|
|
||||||
def playlists(plex_playlist_type):
|
def playlists(content_type):
|
||||||
"""
|
"""
|
||||||
Lists all Plex playlists of the media type plex_playlist_type
|
Lists all Plex playlists of the media type plex_playlist_type
|
||||||
|
content_type: 'audio', 'video'
|
||||||
"""
|
"""
|
||||||
LOG.debug('Listing Plex %s playlists', plex_playlist_type)
|
LOG.debug('Listing Plex %s playlists', content_type)
|
||||||
if not _wait_for_auth():
|
if not _wait_for_auth():
|
||||||
return
|
return
|
||||||
xbmcplugin.setContent(int(argv[1]), 'files')
|
xbmcplugin.setContent(int(argv[1]), 'files')
|
||||||
|
@ -690,7 +696,7 @@ def playlists(plex_playlist_type):
|
||||||
return
|
return
|
||||||
for item in xml:
|
for item in xml:
|
||||||
api = API(item)
|
api = API(item)
|
||||||
if not api.playlist_type() == plex_playlist_type:
|
if not api.playlist_type() == content_type:
|
||||||
continue
|
continue
|
||||||
listitem = ListItem(api.title())
|
listitem = ListItem(api.title())
|
||||||
listitem.setArt({'thumb': api.one_artwork('composite')})
|
listitem.setArt({'thumb': api.one_artwork('composite')})
|
||||||
|
|
|
@ -137,7 +137,6 @@ class VideoNodes(object):
|
||||||
'11': "recommended",
|
'11': "recommended",
|
||||||
'12': "ondeck",
|
'12': "ondeck",
|
||||||
'13': 'browsefiles',
|
'13': 'browsefiles',
|
||||||
'14': 'playlists'
|
|
||||||
}
|
}
|
||||||
mediatypes = {
|
mediatypes = {
|
||||||
# label according to nodetype per mediatype
|
# label according to nodetype per mediatype
|
||||||
|
@ -153,7 +152,6 @@ class VideoNodes(object):
|
||||||
'11': 30230,
|
'11': 30230,
|
||||||
'12': 39500,
|
'12': 39500,
|
||||||
'13': 39702,
|
'13': 39702,
|
||||||
'14': 136
|
|
||||||
},
|
},
|
||||||
|
|
||||||
'tvshows':
|
'tvshows':
|
||||||
|
@ -169,7 +167,6 @@ class VideoNodes(object):
|
||||||
# '11': 30230,
|
# '11': 30230,
|
||||||
'12': 39500,
|
'12': 39500,
|
||||||
'13': 39702,
|
'13': 39702,
|
||||||
'14': 136
|
|
||||||
},
|
},
|
||||||
|
|
||||||
'homevideos':
|
'homevideos':
|
||||||
|
@ -205,7 +202,6 @@ class VideoNodes(object):
|
||||||
'2': 517, # Recently played albums
|
'2': 517, # Recently played albums
|
||||||
'2': 359, # Recently added albums
|
'2': 359, # Recently added albums
|
||||||
'13': 39702, # browse by folder
|
'13': 39702, # browse by folder
|
||||||
'14': 136 # Playlists
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -224,7 +220,6 @@ class VideoNodes(object):
|
||||||
'11': '5', # "recommended",
|
'11': '5', # "recommended",
|
||||||
'12': '1', # "ondeck"
|
'12': '1', # "ondeck"
|
||||||
'13': '9', # browse by folder
|
'13': '9', # browse by folder
|
||||||
'14': '10' # Playlists
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nodes = mediatypes[mediatype]
|
nodes = mediatypes[mediatype]
|
||||||
|
@ -270,12 +265,6 @@ class VideoNodes(object):
|
||||||
nodetype = 'inprogress'
|
nodetype = 'inprogress'
|
||||||
elif nodetype == 'browsefiles':
|
elif nodetype == 'browsefiles':
|
||||||
path = 'plugin://plugin.video.plexkodiconnect?mode=browseplex&key=/library/sections/%s/folder' % viewid
|
path = 'plugin://plugin.video.plexkodiconnect?mode=browseplex&key=/library/sections/%s/folder' % viewid
|
||||||
elif nodetype == 'playlists':
|
|
||||||
path = 'plugin://plugin.video.plexkodiconnect?mode=playlists'
|
|
||||||
if mediatype in ('movies', 'tvshows', 'homevideos'):
|
|
||||||
path += '&type=%s' % v.PLEX_TYPE_VIDEO_PLAYLIST
|
|
||||||
else:
|
|
||||||
path += '&type=%s' % v.PLEX_TYPE_AUDIO_PLAYLIST
|
|
||||||
else:
|
else:
|
||||||
path = "library://video/Plex-%s/%s_%s.xml" % (dirname, viewid, nodetype)
|
path = "library://video/Plex-%s/%s_%s.xml" % (dirname, viewid, nodetype)
|
||||||
|
|
||||||
|
@ -320,8 +309,7 @@ class VideoNodes(object):
|
||||||
if (nodetype in ("nextepisodes",
|
if (nodetype in ("nextepisodes",
|
||||||
"ondeck",
|
"ondeck",
|
||||||
'recentepisodes',
|
'recentepisodes',
|
||||||
'browsefiles',
|
'browsefiles') or mediatype == "homevideos"):
|
||||||
'playlists') or mediatype == "homevideos"):
|
|
||||||
# Folder type with plugin path
|
# Folder type with plugin path
|
||||||
root = self.commonRoot(order=sortorder[node],
|
root = self.commonRoot(order=sortorder[node],
|
||||||
label=label,
|
label=label,
|
||||||
|
@ -340,8 +328,7 @@ class VideoNodes(object):
|
||||||
if (nodetype in ("nextepisodes",
|
if (nodetype in ("nextepisodes",
|
||||||
"ondeck",
|
"ondeck",
|
||||||
'recentepisodes',
|
'recentepisodes',
|
||||||
'browsefiles',
|
'browsefiles') or mediatype == "homevideos"):
|
||||||
'playlists') or mediatype == "homevideos"):
|
|
||||||
etree.SubElement(root, 'path').text = path
|
etree.SubElement(root, 'path').text = path
|
||||||
else:
|
else:
|
||||||
# Elements per nodetype
|
# Elements per nodetype
|
||||||
|
|
Loading…
Reference in a new issue