diff --git a/resources/lib/videonodes.py b/resources/lib/videonodes.py index 328ca868..b48c6ac8 100644 --- a/resources/lib/videonodes.py +++ b/resources/lib/videonodes.py @@ -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