mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2025-01-26 01:46:11 +00:00
Nest emby video nodes logically (#55)
* Nest emby video nodes logically * Node cleanup
This commit is contained in:
parent
4f7c63d5df
commit
83ab855999
2 changed files with 13 additions and 6 deletions
|
@ -572,6 +572,13 @@ def deleteNodes():
|
||||||
|
|
||||||
# Clean up video nodes
|
# Clean up video nodes
|
||||||
import shutil
|
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')
|
path = xbmc.translatePath("special://profile/library/video/").decode('utf-8')
|
||||||
dirs, files = xbmcvfs.listdir(path)
|
dirs, files = xbmcvfs.listdir(path)
|
||||||
for dir in dirs:
|
for dir in dirs:
|
||||||
|
|
|
@ -58,7 +58,7 @@ class VideoNodes(object):
|
||||||
|
|
||||||
path = xbmc.translatePath("special://profile/library/video/").decode('utf-8')
|
path = xbmc.translatePath("special://profile/library/video/").decode('utf-8')
|
||||||
nodepath = xbmc.translatePath(
|
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
|
# Verify the video directory
|
||||||
if not xbmcvfs.exists(path):
|
if not xbmcvfs.exists(path):
|
||||||
|
@ -86,7 +86,7 @@ class VideoNodes(object):
|
||||||
# Create index entry
|
# Create index entry
|
||||||
nodeXML = "%sindex.xml" % nodepath
|
nodeXML = "%sindex.xml" % nodepath
|
||||||
# Set windows property
|
# Set windows property
|
||||||
path = "library://video/Emby - %s/" % dirname
|
path = "library://video/emby/%s/" % dirname
|
||||||
for i in range(1, indexnumber):
|
for i in range(1, indexnumber):
|
||||||
# Verify to make sure we don't create duplicates
|
# Verify to make sure we don't create duplicates
|
||||||
if window('Emby.nodes.%s.index' % i) == path:
|
if window('Emby.nodes.%s.index' % i) == path:
|
||||||
|
@ -178,7 +178,7 @@ class VideoNodes(object):
|
||||||
for node in nodes:
|
for node in nodes:
|
||||||
|
|
||||||
nodetype = nodetypes[node]
|
nodetype = nodetypes[node]
|
||||||
nodeXML = "%s%s_%s.xml" % (nodepath, viewid, nodetype)
|
nodeXML = "%s%s.xml" % (nodepath, nodetype)
|
||||||
# Get label
|
# Get label
|
||||||
stringid = nodes[node]
|
stringid = nodes[node]
|
||||||
if node != "1":
|
if node != "1":
|
||||||
|
@ -207,7 +207,7 @@ class VideoNodes(object):
|
||||||
# Custom query
|
# Custom query
|
||||||
path = "plugin://plugin.video.emby/?id=%s&mode=inprogressepisodes&limit=25"% tagname
|
path = "plugin://plugin.video.emby/?id=%s&mode=inprogressepisodes&limit=25"% tagname
|
||||||
else:
|
else:
|
||||||
path = "library://video/Emby - %s/%s_%s.xml" % (dirname, viewid, nodetype)
|
path = "library://video/emby/%s/%s.xml" % (viewid, nodetype)
|
||||||
|
|
||||||
if mediatype == "photos":
|
if mediatype == "photos":
|
||||||
windowpath = "ActivateWindow(Pictures,%s,return)" % path
|
windowpath = "ActivateWindow(Pictures,%s,return)" % path
|
||||||
|
|
Loading…
Reference in a new issue