Fix to video node refresh

This commit is contained in:
tomkat83 2017-01-20 15:46:34 +01:00
parent 45ccc3ff3f
commit 33ceb3ee33
1 changed files with 9 additions and 9 deletions

View File

@ -59,12 +59,20 @@ class VideoNodes(object):
dirname = "%s-%s" % (viewid, mediatype)
else:
dirname = viewid
path = tryDecode(xbmc.translatePath(
"special://profile/library/video/"))
nodepath = tryDecode(xbmc.translatePath(
"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
# KODI BUG
# Kodi caches the result of exists for directories
@ -82,14 +90,6 @@ class VideoNodes(object):
# folder does not exist yet
log.debug('Creating folder %s' % 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
nodeXML = "%sindex.xml" % nodepath