add a loop for deleting the database if it fails first time and back out

if it does not work
This commit is contained in:
im85288 2015-04-03 11:33:44 +01:00
parent 1b20863cf9
commit c473305556

View file

@ -171,7 +171,18 @@ def reset():
xbmc.sleep(1000)
# delete db
os.remove(getKodiDBPath())
deletecount = 0
deleted = False
while(deleted == False):
try:
os.remove(getKodiDBPath())
deleted = True
except:
deletecount += 1
if(deletecount > 10):
dialog.ok('Warning', 'Could not delete Database, please try again later')
return
xbmc.sleep(1000)
# remove from addon data directory
addon = xbmcaddon.Addon(id='plugin.video.emby')