changes to prevent doubled paths and support for transcoding

This commit is contained in:
Marcel van der Veldt 2015-03-31 23:21:51 +02:00
commit 1388eda326
2 changed files with 112 additions and 96 deletions

View file

@ -250,4 +250,13 @@ def CleanName(filename):
cleanedFilename = unicodedata.normalize('NFKD', filename).encode('ASCII', 'ignore')
return ''.join(c for c in cleanedFilename if c in validFilenameChars)
def removeDirectory(path):
if xbmcvfs.exists(path):
allDirs, allFiles = xbmcvfs.listdir(path)
for dir in allDirs:
xbmcvfs.rmdir(os.path.join(path,dir))
for file in allFiles:
xbmcvfs.delete(os.path.join(path,file))
xbmcvfs.rmdir(path)