Language strings for library sync

This commit is contained in:
tomkat83 2016-03-08 11:47:46 +01:00
parent 0b4736b01b
commit 8ab99b5036
3 changed files with 46 additions and 28 deletions

View file

@ -396,4 +396,13 @@
<string id="39308">Could not log in user </string> <string id="39308">Could not log in user </string>
<string id="39309">Please try again.</string> <string id="39309">Please try again.</string>
<!-- Plex Librarysync.py -->
<string id="39400">Library sync thread has crashed. You should restart Kodi now. Please report this on the forum</string>
<string id="39401">Detected Kodi database needs to be recreated for this version. This might take a while. Proceed?</string>
<string id="39402"> may not work correctly until the database is reset.</string>
<string id="39403">Cancelling the database syncing process. Current Kodi version is unsupported. Please verify your logs for more info.</string>
<string id="39404">Startup syncing process failed repeatedly. Try restarting Kodi. Stopping Sync for now.</string>
<string id="39405">Plex playlists/nodes refreshed</string>
<string id="39406">Plex playlists/nodes refresh failed</string>
</strings> </strings>

View file

@ -327,4 +327,13 @@
<string id="39308">Anmeldung fehlgeschlagen für Benutzer </string> <string id="39308">Anmeldung fehlgeschlagen für Benutzer </string>
<string id="39309">Bitte erneut versuchen.</string> <string id="39309">Bitte erneut versuchen.</string>
<!-- Plex Librarysync.py -->
<string id="39400">Die Synchronisierung der Plex Bibliotheken ist abgestürzt. Bitte Kodi neu starten. Danke, wenn Sie sich die Zeit nehmen und im Plex Forum vom Absturz berichten.</string>
<string id="39401">Die Kodi Datenbank muss neu kreiert werden für diese Version. Das kann eine Weile dauern. Fortfahren?</string>
<string id="39402"> funktioniert möglicherweise nicht richtig, bis die Kodi Datenbank zurückgesetzt worden ist.</string>
<string id="39403">Synchronisierung der Plex Bibliotheken wird abgebrochen. Die momentane Kodi Version wird nicht unterstützt. Für weitere Informationen bitte das Kodi Log konsultieren.</string>
<string id="39404">Der Startup Synchronisations-Prozess der Plex Bibliotheken ist mehrmals fehlgeschlagen. Bitte Kodi neu starten. Synch wird jetzt gestoppt.</string>
<string id="39405">Plex Playlisten/Nodes aktualisiert</string>
<string id="39406">Plex Playlisten/Nodes Aktualisierung fehlgeschlagen</string>
</strings> </strings>

View file

@ -8,6 +8,7 @@ import Queue
import xbmc import xbmc
import xbmcgui import xbmcgui
import xbmcvfs import xbmcvfs
import xbmcaddon
import utils import utils
import clientinfo import clientinfo
@ -213,6 +214,8 @@ class LibrarySync(Thread):
self.__dict__ = self._shared_state self.__dict__ = self._shared_state
self.__language__ = xbmcaddon.Addon().getLocalizedString
self.clientInfo = clientinfo.ClientInfo() self.clientInfo = clientinfo.ClientInfo()
self.user = userclient.UserClient() self.user = userclient.UserClient()
self.emby = embyserver.Read_EmbyServer() self.emby = embyserver.Read_EmbyServer()
@ -1111,11 +1114,10 @@ class LibrarySync(Thread):
self.run_internal() self.run_internal()
except Exception as e: except Exception as e:
utils.window('emby_dbScan', clear=True) utils.window('emby_dbScan', clear=True)
# Library sync thread has crashed
xbmcgui.Dialog().ok( xbmcgui.Dialog().ok(
heading=self.addonName, heading=self.addonName,
line1=("Library sync thread has crashed. " line1=self.__language__(39400))
"You should restart Kodi now. "
"Please report this on the forum."))
raise raise
def run_internal(self): def run_internal(self):
@ -1129,6 +1131,7 @@ class LibrarySync(Thread):
enableBackgroundSync = self.enableBackgroundSync enableBackgroundSync = self.enableBackgroundSync
fullSync = self.fullSync fullSync = self.fullSync
fastSync = self.fastSync fastSync = self.fastSync
string = self.__language__
dialog = xbmcgui.Dialog() dialog = xbmcgui.Dialog()
@ -1158,17 +1161,14 @@ class LibrarySync(Thread):
if not uptoDate: if not uptoDate:
log("Db version out of date: %s minimum version required: " log("Db version out of date: %s minimum version required: "
"%s" % (currentVersion, minVersion), 0) "%s" % (currentVersion, minVersion), 0)
resp = dialog.yesno( # DB out of date. Proceed to recreate?
heading="Db Version", resp = dialog.yesno(heading=self.addonName,
line1=("Detected the database needs to be recreated " line1=string(39401))
"for this version of " + self.addonName +
"Proceed?"))
if not resp: if not resp:
log("Db version out of date! USER IGNORED!", 0) log("Db version out of date! USER IGNORED!", 0)
dialog.ok( # PKC may not work correctly until reset
heading=self.addonName, dialog.ok(heading=self.addonName,
line1=(self.addonName + " may not work correctly " line1=(self.addonName + string(39402)))
"until the database is reset."))
else: else:
utils.reset() utils.reset()
break break
@ -1182,13 +1182,12 @@ class LibrarySync(Thread):
if not xbmcvfs.exists(videoDb): if not xbmcvfs.exists(videoDb):
# Database does not exists # Database does not exists
log("The current Kodi version is incompatible " log("The current Kodi version is incompatible "
"to know which Kodi versions are supported.", 0) "to know which Kodi versions are supported.", -1)
dialog.ok( log('Current Kodi version: %s' % xbmc.getInfoLabel(
heading=self.addonName, 'System.BuildVersion').decode('utf-8'))
line1=("Cancelling the database syncing process. " # "Current Kodi version is unsupported, cancel lib sync"
"Current Kodi version: %s is unsupported. " dialog.ok(heading=self.addonName,
"Please verify your logs for more info." line1=string(39403))
% xbmc.getInfoLabel('System.BuildVersion')))
break break
# Run start up sync # Run start up sync
@ -1209,11 +1208,10 @@ class LibrarySync(Thread):
errorcount += 1 errorcount += 1
if errorcount > 2: if errorcount > 2:
log("Startup full sync failed. Stopping sync", -1) log("Startup full sync failed. Stopping sync", -1)
dialog.ok( # "Startup syncing process failed repeatedly"
heading=self.addonName, # "Please restart"
line1=("Startup syncing process failed repeatedly." dialog.ok(heading=self.addonName,
" Try restarting Kodi. Stopping Sync for " line1=string(39404))
"now."))
break break
# Currently no db scan, so we can start a new scan # Currently no db scan, so we can start a new scan
@ -1239,18 +1237,21 @@ class LibrarySync(Thread):
# Kick off refresh # Kick off refresh
if self.maintainViews(): if self.maintainViews():
# Ran successfully # Ran successfully
log("Refresh playlists/nodes completed", 0)
# "Plex playlists/nodes refreshed"
dialog.notification( dialog.notification(
heading=self.addonName, heading=self.addonName,
message="Plex playlists/nodes refreshed", message=string(39405),
icon="special://home/addons/plugin.video.plexkodiconnect/icon.png", icon="special://home/addons/plugin.video.plexkodiconnect/icon.png",
time=3000, time=3000,
sound=True) sound=True)
else: else:
# Failed # Failed
log("Refresh playlists/nodes failed", -1) log("Refresh playlists/nodes failed", -1)
# "Plex playlists/nodes refresh failed"
dialog.notification( dialog.notification(
heading=self.addonName, heading=self.addonName,
message="Plex playlists/nodes refresh failed", message=string(39406),
icon=xbmcgui.NOTIFICATION_ERROR, icon=xbmcgui.NOTIFICATION_ERROR,
time=3000, time=3000,
sound=True) sound=True)
@ -1268,8 +1269,7 @@ class LibrarySync(Thread):
window('emby_dbScan', value="true") window('emby_dbScan', value="true")
if not fastSync(): if not fastSync():
# Fast sync failed or server plugin is not found # Fast sync failed or server plugin is not found
self.logMsg( log("Something went wrong, starting full sync", -1)
"Something went wrong, starting full sync", -1)
fullSync(manualrun=True) fullSync(manualrun=True)
window('emby_dbScan', clear=True) window('emby_dbScan', clear=True)