Optimize code
This commit is contained in:
parent
30f7cdf701
commit
232d3a3199
2 changed files with 6 additions and 7 deletions
|
@ -670,11 +670,11 @@ def on_deck_episodes(viewid, tagname, limit):
|
||||||
xbmcplugin.endOfDirectory(handle=int(argv[1]))
|
xbmcplugin.endOfDirectory(handle=int(argv[1]))
|
||||||
|
|
||||||
|
|
||||||
def playlists(kodi_playlist_type):
|
def playlists(plex_playlist_type):
|
||||||
"""
|
"""
|
||||||
Lists all Plex playlists of the media type kodi_playlist_type
|
Lists all Plex playlists of the media type plex_playlist_type
|
||||||
"""
|
"""
|
||||||
LOG.debug('Listing Plex %s playlists', kodi_playlist_type)
|
LOG.debug('Listing Plex %s playlists', plex_playlist_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')
|
||||||
|
@ -684,8 +684,7 @@ def playlists(kodi_playlist_type):
|
||||||
return
|
return
|
||||||
for item in xml:
|
for item in xml:
|
||||||
api = API(item)
|
api = API(item)
|
||||||
if not v.KODI_PLAYLIST_TYPE_FROM_PLEX[api.playlist_type()] \
|
if not api.playlist_type() == plex_playlist_type:
|
||||||
== kodi_playlist_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')})
|
||||||
|
|
|
@ -263,9 +263,9 @@ class VideoNodes(object):
|
||||||
elif nodetype == 'playlists':
|
elif nodetype == 'playlists':
|
||||||
path = 'plugin://plugin.video.plexkodiconnect?mode=playlists'
|
path = 'plugin://plugin.video.plexkodiconnect?mode=playlists'
|
||||||
if mediatype in ('movies', 'tvshows', 'homevideos'):
|
if mediatype in ('movies', 'tvshows', 'homevideos'):
|
||||||
path += '&type=%s' % v.KODI_PLAYLIST_TYPE_VIDEO
|
path += '&type=%s' % v.PLEX_TYPE_VIDEO_PLAYLIST
|
||||||
else:
|
else:
|
||||||
path += '&type=%s' % v.KODI_PLAYLIST_TYPE_AUDIO
|
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)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue