Fix to video node refresh

This commit is contained in:
tomkat83 2017-01-20 15:46:34 +01:00
parent 45ccc3ff3f
commit 33ceb3ee33

View file

@ -59,12 +59,20 @@ class VideoNodes(object):
dirname = "%s-%s" % (viewid, mediatype) dirname = "%s-%s" % (viewid, mediatype)
else: else:
dirname = viewid dirname = viewid
path = tryDecode(xbmc.translatePath( path = tryDecode(xbmc.translatePath(
"special://profile/library/video/")) "special://profile/library/video/"))
nodepath = tryDecode(xbmc.translatePath( nodepath = tryDecode(xbmc.translatePath(
"special://profile/library/video/Plex-%s/" % dirname)) "special://profile/library/video/Plex-%s/" % dirname))
if delete:
dirs, files = xbmcvfs.listdir(tryEncode(nodepath))
for file in files:
xbmcvfs.delete(tryEncode(
(nodepath + tryDecode(file))))
log.info("Sucessfully removed videonode: %s." % tagname)
return
# Verify the video directory # Verify the video directory
# KODI BUG # KODI BUG
# Kodi caches the result of exists for directories # Kodi caches the result of exists for directories
@ -82,14 +90,6 @@ class VideoNodes(object):
# folder does not exist yet # folder does not exist yet
log.debug('Creating folder %s' % nodepath) log.debug('Creating folder %s' % nodepath)
xbmcvfs.mkdirs(tryEncode(nodepath)) xbmcvfs.mkdirs(tryEncode(nodepath))
if delete:
dirs, files = xbmcvfs.listdir(tryEncode(nodepath))
for file in files:
xbmcvfs.delete(tryEncode(
(nodepath + tryDecode(file))))
log.info("Sucessfully removed videonode: %s." % tagname)
return
# Create index entry # Create index entry
nodeXML = "%sindex.xml" % nodepath nodeXML = "%sindex.xml" % nodepath