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
1 changed files with 13 additions and 2 deletions

View File

@ -171,7 +171,18 @@ def reset():
xbmc.sleep(1000)
# delete db
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')