Fix playlist/videonodes deletion

Using the view Id instead of actual name for folder creation, to prevent
deletion error (due to folder containing special characters).
This commit is contained in:
angelblue05 2016-02-23 18:40:13 -06:00
parent dc74bf42aa
commit f394dc39dc
1 changed files with 8 additions and 2 deletions

View File

@ -516,7 +516,13 @@ def deleteNodes():
dirs, files = xbmcvfs.listdir(path) dirs, files = xbmcvfs.listdir(path)
for dir in dirs: for dir in dirs:
if dir.decode('utf-8').startswith('Emby'): if dir.decode('utf-8').startswith('Emby'):
try:
shutil.rmtree("%s%s" % (path, dir.decode('utf-8'))) shutil.rmtree("%s%s" % (path, dir.decode('utf-8')))
except:
logMsg("EMBY", "Failed to delete directory: %s" % dir.decode('utf-8'))
for file in files: for file in files:
if file.decode('utf-8').startswith('emby'): if file.decode('utf-8').startswith('emby'):
try:
xbmcvfs.delete("%s%s" % (path, file.decode('utf-8'))) xbmcvfs.delete("%s%s" % (path, file.decode('utf-8')))
except:
logMsg("EMBY", "Failed to file: %s" % file.decode('utf-8'))