Nest emby video nodes logically (#55)

* Nest emby video nodes logically

* Node cleanup
This commit is contained in:
delphiactual 2016-11-04 04:14:35 -06:00 committed by angelblue05
parent 4f7c63d5df
commit 83ab855999
2 changed files with 13 additions and 6 deletions

View File

@ -572,6 +572,13 @@ def deleteNodes():
# Clean up video nodes
import shutil
path = xbmc.translatePath("special://profile/library/video/emby/").decode('utf-8')
if (xbmcvfs.exists(path)):
try:
shutil.rmtree(path)
except:
log.warn("Failed to delete directory: %s" % path)
# Old cleanup code kept for cleanup of old style nodes
path = xbmc.translatePath("special://profile/library/video/").decode('utf-8')
dirs, files = xbmcvfs.listdir(path)
for dir in dirs:

View File

@ -58,7 +58,7 @@ class VideoNodes(object):
path = xbmc.translatePath("special://profile/library/video/").decode('utf-8')
nodepath = xbmc.translatePath(
"special://profile/library/video/Emby - %s/" % dirname).decode('utf-8')
"special://profile/library/video/emby/%s/" % dirname).decode('utf-8')
# Verify the video directory
if not xbmcvfs.exists(path):
@ -86,7 +86,7 @@ class VideoNodes(object):
# Create index entry
nodeXML = "%sindex.xml" % nodepath
# Set windows property
path = "library://video/Emby - %s/" % dirname
path = "library://video/emby/%s/" % dirname
for i in range(1, indexnumber):
# Verify to make sure we don't create duplicates
if window('Emby.nodes.%s.index' % i) == path:
@ -178,7 +178,7 @@ class VideoNodes(object):
for node in nodes:
nodetype = nodetypes[node]
nodeXML = "%s%s_%s.xml" % (nodepath, viewid, nodetype)
nodeXML = "%s%s.xml" % (nodepath, nodetype)
# Get label
stringid = nodes[node]
if node != "1":
@ -207,7 +207,7 @@ class VideoNodes(object):
# Custom query
path = "plugin://plugin.video.emby/?id=%s&mode=inprogressepisodes&limit=25"% tagname
else:
path = "library://video/Emby - %s/%s_%s.xml" % (dirname, viewid, nodetype)
path = "library://video/emby/%s/%s.xml" % (viewid, nodetype)
if mediatype == "photos":
windowpath = "ActivateWindow(Pictures,%s,return)" % path