Fix WindowsError or alike when deleting video nodes

This commit is contained in:
tomkat83 2017-05-17 14:42:28 +02:00
parent b532b74b84
commit 209cd78315
1 changed files with 4 additions and 4 deletions

View File

@ -68,10 +68,10 @@ class VideoNodes(object):
"special://profile/library/video/Plex-%s/" % dirname)
if delete:
files = [f for f in listdir(nodepath) if isfile(join(nodepath, f))]
for file in files:
remove(nodepath + file)
log.info("Sucessfully removed videonode: %s." % tagname)
if exists_dir(nodepath):
from shutil import rmtree
rmtree(nodepath)
log.info("Sucessfully removed videonode: %s." % tagname)
return
# Verify the video directory