directory has to end in slash to use exists()

This commit is contained in:
Rob Weber 2017-12-06 09:22:27 -06:00
parent 622939901e
commit 8c61616d3c

View File

@ -89,9 +89,14 @@ class AdvancedBackupEditor:
if(enterHome): if(enterHome):
rootFolder = self.dialog.input(utils.getString(30116),defaultt=rootFolder) rootFolder = self.dialog.input(utils.getString(30116),defaultt=rootFolder)
#direcotry has to end in slash
if(rootFolder[:-1] != '/'):
rootFolder = rootFolder + '/'
#check that this path even exists #check that this path even exists
if(not xbmcvfs.exists(xbmc.translatePath(rootFolder))): if(not xbmcvfs.exists(xbmc.translatePath(rootFolder))):
self.dialog.ok(utils.getString(30117),utils.getString(30118),rootFolder) self.dialog.ok(utils.getString(30117),utils.getString(30118),rootFolder)
return None
else: else:
#select path to start set #select path to start set
rootFolder = self.dialog.browse(type=0,heading=utils.getString(30119),shares='files',defaultt=rootFolder) rootFolder = self.dialog.browse(type=0,heading=utils.getString(30119),shares='files',defaultt=rootFolder)