Better warnings when resetting the Kodi database
* @Pavuucek please have a look at the Czech translation file, very bottom. Missing language tags are marked with `<!-- PLEASE UPDATE -->`
This commit is contained in:
parent
8b9c116f26
commit
4d957aa4a3
4 changed files with 39 additions and 19 deletions
|
@ -507,5 +507,9 @@
|
||||||
<string id="39500">Aktuální</string>
|
<string id="39500">Aktuální</string>
|
||||||
<string id="39501">Kolekce</string>
|
<string id="39501">Kolekce</string>
|
||||||
|
|
||||||
|
<!-- Plex utils.py -->
|
||||||
|
<string id="39600">Are you sure you want to reset your local Kodi database? A re-sync of the Plex data will take time afterwards.</string><!-- PLEASE UPDATE -->
|
||||||
|
<string id="39601">Could not stop the database from running. Please try again later.</string><!-- PLEASE UPDATE -->
|
||||||
|
<string id="39602">Remove all cached artwork? (recommended!)</string><!-- PLEASE UPDATE -->
|
||||||
|
<string id="39603">Reset all PlexKodiConnect Addon settings? (this is usually NOT recommended and unnecessary!)</string><!-- PLEASE UPDATE -->
|
||||||
</strings>
|
</strings>
|
||||||
|
|
|
@ -507,5 +507,9 @@
|
||||||
<string id="39500">On Deck</string>
|
<string id="39500">On Deck</string>
|
||||||
<string id="39501">Collections</string>
|
<string id="39501">Collections</string>
|
||||||
|
|
||||||
|
<!-- Plex utils.py -->
|
||||||
|
<string id="39600">Are you sure you want to reset your local Kodi database? A re-sync of the Plex data will take time afterwards.</string>
|
||||||
|
<string id="39601">Could not stop the database from running. Please try again later.</string>
|
||||||
|
<string id="39602">Remove all cached artwork? (recommended!)</string>
|
||||||
|
<string id="39603">Reset all PlexKodiConnect Addon settings? (this is usually NOT recommended and unnecessary!)</string>
|
||||||
</strings>
|
</strings>
|
||||||
|
|
|
@ -458,5 +458,9 @@
|
||||||
<string id="39500">Aktuell</string>
|
<string id="39500">Aktuell</string>
|
||||||
<string id="39501">Kollektionen</string>
|
<string id="39501">Kollektionen</string>
|
||||||
|
|
||||||
|
<!-- Plex utils.py -->
|
||||||
|
<string id="39600">Wirklich die lokale Kodi Datenbank zurücksetzen? Die anschliessende Synchronisation der Plex-Daten benötigt Zeit.</string>
|
||||||
|
<string id="39601">Kodi Datenbank konnte nicht gestoppt werden. Bitte später erneut versuchen.</string>
|
||||||
|
<string id="39602">Alle zwischengespeicherten Bilder löschen? (empfohlen!)</string>
|
||||||
|
<string id="39603">Alle PlexKodiConnect Einstellungen zurücksetzen? (normalerweise NICHT empfohlen und nicht nötig!)</string>
|
||||||
</strings>
|
</strings>
|
||||||
|
|
|
@ -306,11 +306,12 @@ def setScreensaver(value):
|
||||||
log.debug("Toggling screensaver: %s %s"
|
log.debug("Toggling screensaver: %s %s"
|
||||||
% (value, xbmc.executeJSONRPC(dumps(query))))
|
% (value, xbmc.executeJSONRPC(dumps(query))))
|
||||||
|
|
||||||
|
|
||||||
def reset():
|
def reset():
|
||||||
|
# Are you sure you want to reset your local Kodi database?
|
||||||
dialog = xbmcgui.Dialog()
|
if not dialog('yesno',
|
||||||
|
heading='{plex} %s ' % language(30132),
|
||||||
if dialog.yesno("Warning", "Are you sure you want to reset your local Kodi database?") == 0:
|
line1=language(39600)):
|
||||||
return
|
return
|
||||||
|
|
||||||
# first stop any db sync
|
# first stop any db sync
|
||||||
|
@ -320,7 +321,10 @@ def reset():
|
||||||
log.debug("Sync is running, will retry: %s..." % count)
|
log.debug("Sync is running, will retry: %s..." % count)
|
||||||
count -= 1
|
count -= 1
|
||||||
if count == 0:
|
if count == 0:
|
||||||
dialog.ok("Warning", "Could not stop the database from running. Try again.")
|
# Could not stop the database from running. Please try again later.
|
||||||
|
dialog('ok',
|
||||||
|
heading='{plex} %s' % language(30132),
|
||||||
|
line1=language(39601))
|
||||||
return
|
return
|
||||||
xbmc.sleep(1000)
|
xbmc.sleep(1000)
|
||||||
|
|
||||||
|
@ -371,9 +375,10 @@ def reset():
|
||||||
connection.commit()
|
connection.commit()
|
||||||
cursor.close()
|
cursor.close()
|
||||||
|
|
||||||
# Offer to wipe cached thumbnails
|
# Remove all cached artwork? (recommended!)
|
||||||
resp = dialog.yesno("Warning", "Remove all cached artwork?")
|
if dialog('yesno',
|
||||||
if resp:
|
heading='{plex} %s ' % language(30132),
|
||||||
|
line1=language(39602)):
|
||||||
log.info("Resetting all cached artwork.")
|
log.info("Resetting all cached artwork.")
|
||||||
# Remove all existing textures first
|
# Remove all existing textures first
|
||||||
path = tryDecode(xbmc.translatePath("special://thumbnails/"))
|
path = tryDecode(xbmc.translatePath("special://thumbnails/"))
|
||||||
|
@ -390,7 +395,6 @@ def reset():
|
||||||
xbmcvfs.delete(os_path.join(
|
xbmcvfs.delete(os_path.join(
|
||||||
tryEncode(path) + dir,
|
tryEncode(path) + dir,
|
||||||
file))
|
file))
|
||||||
|
|
||||||
# remove all existing data from texture DB
|
# remove all existing data from texture DB
|
||||||
connection = kodiSQL('texture')
|
connection = kodiSQL('texture')
|
||||||
cursor = connection.cursor()
|
cursor = connection.cursor()
|
||||||
|
@ -406,21 +410,25 @@ def reset():
|
||||||
# reset the install run flag
|
# reset the install run flag
|
||||||
settings('SyncInstallRunDone', value="false")
|
settings('SyncInstallRunDone', value="false")
|
||||||
|
|
||||||
# Remove emby info
|
# Reset all PlexKodiConnect Addon settings? (this is usually NOT
|
||||||
resp = dialog.yesno("Warning", "Reset all Plex KodiConnect Addon settings?")
|
# recommended and unnecessary!)
|
||||||
if resp:
|
if dialog('yesno',
|
||||||
|
heading='{plex} %s ' % language(30132),
|
||||||
|
line1=language(39603)):
|
||||||
# Delete the settings
|
# Delete the settings
|
||||||
addon = xbmcaddon.Addon()
|
addon = xbmcaddon.Addon()
|
||||||
addondir = tryDecode(xbmc.translatePath(addon.getAddonInfo('profile')))
|
addondir = tryDecode(xbmc.translatePath(addon.getAddonInfo('profile')))
|
||||||
dataPath = "%ssettings.xml" % addondir
|
dataPath = "%ssettings.xml" % addondir
|
||||||
xbmcvfs.delete(tryEncode(dataPath))
|
|
||||||
log.info("Deleting: settings.xml")
|
log.info("Deleting: settings.xml")
|
||||||
|
xbmcvfs.delete(tryEncode(dataPath))
|
||||||
|
|
||||||
dialog.ok(
|
# Kodi will now restart to apply the changes.
|
||||||
heading=language(29999),
|
dialog('ok',
|
||||||
line1="Database reset has completed, Kodi will now restart to apply the changes.")
|
heading='{plex} %s ' % language(30132),
|
||||||
|
line1=language(33033))
|
||||||
xbmc.executebuiltin('RestartApp')
|
xbmc.executebuiltin('RestartApp')
|
||||||
|
|
||||||
|
|
||||||
def profiling(sortby="cumulative"):
|
def profiling(sortby="cumulative"):
|
||||||
# Will print results to Kodi log
|
# Will print results to Kodi log
|
||||||
def decorator(func):
|
def decorator(func):
|
||||||
|
|
Loading…
Reference in a new issue