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)
|
||||
|
||||
elif mode == 'playlists':
|
||||
entrypoint.playlists(params.get('type'))
|
||||
entrypoint.playlists(params.get('content_type'))
|
||||
|
||||
elif mode == 'hub':
|
||||
entrypoint.hub(params.get('type'))
|
||||
|
|
|
@ -152,6 +152,11 @@ def show_main_menu(content_type=None):
|
|||
'homevideos',
|
||||
'musicvideos') and content_type == 'video':
|
||||
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
|
||||
directory_item('Plex Hub',
|
||||
'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]))
|
||||
|
||||
|
||||
def playlists(plex_playlist_type):
|
||||
def playlists(content_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():
|
||||
return
|
||||
xbmcplugin.setContent(int(argv[1]), 'files')
|
||||
|
@ -690,7 +696,7 @@ def playlists(plex_playlist_type):
|
|||
return
|
||||
for item in xml:
|
||||
api = API(item)
|
||||
if not api.playlist_type() == plex_playlist_type:
|
||||
if not api.playlist_type() == content_type:
|
||||
continue
|
||||
listitem = ListItem(api.title())
|
||||
listitem.setArt({'thumb': api.one_artwork('composite')})
|
||||
|
|
|
@ -137,7 +137,6 @@ class VideoNodes(object):
|
|||
'11': "recommended",
|
||||
'12': "ondeck",
|
||||
'13': 'browsefiles',
|
||||
'14': 'playlists'
|
||||
}
|
||||
mediatypes = {
|
||||
# label according to nodetype per mediatype
|
||||
|
@ -153,7 +152,6 @@ class VideoNodes(object):
|
|||
'11': 30230,
|
||||
'12': 39500,
|
||||
'13': 39702,
|
||||
'14': 136
|
||||
},
|
||||
|
||||
'tvshows':
|
||||
|
@ -169,7 +167,6 @@ class VideoNodes(object):
|
|||
# '11': 30230,
|
||||
'12': 39500,
|
||||
'13': 39702,
|
||||
'14': 136
|
||||
},
|
||||
|
||||
'homevideos':
|
||||
|
@ -205,7 +202,6 @@ class VideoNodes(object):
|
|||
'2': 517, # Recently played albums
|
||||
'2': 359, # Recently added albums
|
||||
'13': 39702, # browse by folder
|
||||
'14': 136 # Playlists
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -224,7 +220,6 @@ class VideoNodes(object):
|
|||
'11': '5', # "recommended",
|
||||
'12': '1', # "ondeck"
|
||||
'13': '9', # browse by folder
|
||||
'14': '10' # Playlists
|
||||
}
|
||||
|
||||
nodes = mediatypes[mediatype]
|
||||
|
@ -270,12 +265,6 @@ class VideoNodes(object):
|
|||
nodetype = 'inprogress'
|
||||
elif nodetype == 'browsefiles':
|
||||
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:
|
||||
path = "library://video/Plex-%s/%s_%s.xml" % (dirname, viewid, nodetype)
|
||||
|
||||
|
@ -320,8 +309,7 @@ class VideoNodes(object):
|
|||
if (nodetype in ("nextepisodes",
|
||||
"ondeck",
|
||||
'recentepisodes',
|
||||
'browsefiles',
|
||||
'playlists') or mediatype == "homevideos"):
|
||||
'browsefiles') or mediatype == "homevideos"):
|
||||
# Folder type with plugin path
|
||||
root = self.commonRoot(order=sortorder[node],
|
||||
label=label,
|
||||
|
@ -340,8 +328,7 @@ class VideoNodes(object):
|
|||
if (nodetype in ("nextepisodes",
|
||||
"ondeck",
|
||||
'recentepisodes',
|
||||
'browsefiles',
|
||||
'playlists') or mediatype == "homevideos"):
|
||||
'browsefiles') or mediatype == "homevideos"):
|
||||
etree.SubElement(root, 'path').text = path
|
||||
else:
|
||||
# Elements per nodetype
|
||||
|
|
Loading…
Reference in a new issue