Browse video nodes by folder/path

This commit is contained in:
tomkat83 2017-03-08 16:41:49 +01:00
parent be7ecb95db
commit 6f7d5d5d59
2 changed files with 53 additions and 43 deletions

View file

@ -516,4 +516,5 @@
<string id="39700">Amazon Alexa (Voice Recognition)</string> <string id="39700">Amazon Alexa (Voice Recognition)</string>
<string id="39701">Activate Alexa</string> <string id="39701">Activate Alexa</string>
<string id="39702">Browse by folder</string>
</strings> </strings>

View file

@ -131,7 +131,8 @@ class VideoNodes(object):
'9': "genres", '9': "genres",
'10': "random", '10': "random",
'11': "recommended", '11': "recommended",
'12': "ondeck" '12': "ondeck",
'13': 'browsefiles'
} }
mediatypes = { mediatypes = {
# label according to nodetype per mediatype # label according to nodetype per mediatype
@ -146,6 +147,7 @@ class VideoNodes(object):
'10': 30227, '10': 30227,
'11': 30230, '11': 30230,
'12': 39500, '12': 39500,
'13': 39702
}, },
'tvshows': 'tvshows':
@ -160,13 +162,15 @@ class VideoNodes(object):
'10': 30227, '10': 30227,
# '11': 30230, # '11': 30230,
'12': 39500, '12': 39500,
'13': 39702
}, },
'homevideos': 'homevideos':
{ {
'1': tagname, '1': tagname,
'2': 30251, '2': 30251,
'11': 30253 '11': 30253,
'13': 39702
}, },
'photos': 'photos':
@ -174,7 +178,8 @@ class VideoNodes(object):
'1': tagname, '1': tagname,
'2': 30252, '2': 30252,
'8': 30255, '8': 30255,
'11': 30254 '11': 30254,
'13': 39702
}, },
'musicvideos': 'musicvideos':
@ -182,7 +187,8 @@ class VideoNodes(object):
'1': tagname, '1': tagname,
'2': 30256, '2': 30256,
'4': 30257, '4': 30257,
'6': 30258 '6': 30258,
'13': 39702
} }
} }
@ -200,6 +206,7 @@ class VideoNodes(object):
'10': '8', # "random", '10': '8', # "random",
'11': '5', # "recommended", '11': '5', # "recommended",
'12': '1', # "ondeck" '12': '1', # "ondeck"
'13': '9' # browse by folder
} }
nodes = mediatypes[mediatype] nodes = mediatypes[mediatype]
@ -244,6 +251,8 @@ class VideoNodes(object):
elif mediatype =="movies": elif mediatype =="movies":
# Reset nodetype; we got the label # Reset nodetype; we got the label
nodetype = 'inprogress' nodetype = 'inprogress'
elif nodetype == 'browsefiles':
path = 'plugin://plugin.video.plexkodiconnect?mode=browseplex&key=/library/sections/%s/folder' % viewid
else: else:
path = "library://video/Plex-%s/%s_%s.xml" % (dirname, viewid, nodetype) path = "library://video/Plex-%s/%s_%s.xml" % (dirname, viewid, nodetype)
@ -285,7 +294,7 @@ class VideoNodes(object):
continue continue
# Create the root # Create the root
if (nodetype in ("nextepisodes", "ondeck", 'recentepisodes') or mediatype == "homevideos"): if (nodetype in ("nextepisodes", "ondeck", 'recentepisodes', 'browsefiles') or mediatype == "homevideos"):
# Folder type with plugin path # Folder type with plugin path
root = self.commonRoot(order=sortorder[node], label=label, tagname=tagname, roottype=2) root = self.commonRoot(order=sortorder[node], label=label, tagname=tagname, roottype=2)
etree.SubElement(root, 'path').text = path etree.SubElement(root, 'path').text = path