diff --git a/resources/lib/artwork.py b/resources/lib/artwork.py index ca9af7ea..a8012e6e 100644 --- a/resources/lib/artwork.py +++ b/resources/lib/artwork.py @@ -162,7 +162,8 @@ class Artwork(): import xbmcaddon string = xbmcaddon.Addon().getLocalizedString - if not xbmcgui.Dialog().yesno("Image Texture Cache", string(39250)): + if not xbmcgui.Dialog().yesno( + "Image Texture Cache", string(39250).encode('utf-8')): return self.logMsg("Doing Image Cache Sync", 1) @@ -171,7 +172,8 @@ class Artwork(): dialog.create("Emby for Kodi", "Image Cache Sync") # ask to rest all existing or not - if xbmcgui.Dialog().yesno("Image Texture Cache", string(39251), ""): + if xbmcgui.Dialog().yesno( + "Image Texture Cache", string(39251).encode('utf-8'), ""): self.logMsg("Resetting all cache data first", 1) # Remove all existing textures first path = xbmc.translatePath("special://thumbnails/").decode('utf-8') diff --git a/resources/lib/entrypoint.py b/resources/lib/entrypoint.py index 07f8b84f..e7be13cd 100644 --- a/resources/lib/entrypoint.py +++ b/resources/lib/entrypoint.py @@ -156,7 +156,7 @@ def resetAuth(): string = xbmcaddon.Addon().getLocalizedString resp = xbmcgui.Dialog().yesno( heading="Warning", - line1=string(39206)) + line1=string(39206).encode('utf-8')) if resp == 1: utils.logMsg("PLEX", "Reset login attempts.", 1) utils.window('emby_serverStatus', value="Auth") @@ -226,14 +226,14 @@ def resetDeviceId(): "Failed to generate a new device Id: %s" % e, 1) dialog.ok( heading=addonName, - line1=language(33032)) + line1=language(33032).encode('utf-8')) else: utils.logMsg(addonName, "Successfully removed old deviceId: %s New deviceId: %s" % (deviceId_old, deviceId), 1) dialog.ok( heading=addonName, - line1=language(33033)) + line1=language(33033).encode('utf-8')) xbmc.executebuiltin('RestartApp') ##### ADD ADDITIONAL USERS ##### @@ -1160,6 +1160,6 @@ def RunLibScan(mode): # Server is not online, do not run the sync string = xbmcaddon.Addon().getLocalizedString xbmcgui.Dialog().ok(heading=addonName, - line1=string(39205)) + line1=string(39205).encode('utf-8')) else: utils.window('plex_runLibScan', value='full') diff --git a/resources/lib/librarysync.py b/resources/lib/librarysync.py index 4e685462..e895f42d 100644 --- a/resources/lib/librarysync.py +++ b/resources/lib/librarysync.py @@ -164,10 +164,10 @@ class ThreadedShowSyncInfo(Thread): threadStopped = self.threadStopped downloadLock = self.locks[0] processLock = self.locks[1] - dialog.create("%s: Sync %s: %s items" - % (self.addonName.encode('utf-8'), - self.itemType.encode('utf-8'), - str(total)), + dialog.create(("%s: Sync %s: %s items" + % (self.addonName, + self.itemType, + str(total))).encode('utf-8'), "Starting") global getMetadataCount global processMetadataCount @@ -188,9 +188,9 @@ class ThreadedShowSyncInfo(Thread): try: dialog.update( percentage, - message="Downloaded: %s. Processed: %s: %s" - % (getMetadataProgress, processMetadataProgress, - viewName.decode('utf-8'))) + message=("Downloaded: %s. Processed: %s: %s" + % (getMetadataProgress, processMetadataProgress, + viewName))).encode('utf-8') except: # Wierd formating of the string viewName?!? pass @@ -236,7 +236,7 @@ class LibrarySync(Thread): return xbmcgui.Dialog().notification( heading=self.addonName, - message=message, + message=message.encode('utf-8'), icon="special://home/addons/plugin.video.plexkodiconnect/icon.png", sound=False) diff --git a/resources/lib/player.py b/resources/lib/player.py index b0372da3..24a5a037 100644 --- a/resources/lib/player.py +++ b/resources/lib/player.py @@ -523,7 +523,10 @@ class Player(xbmc.Player): # Plex: never delete offerDelete = False if percentComplete >= markPlayedAt and offerDelete: - resp = xbmcgui.Dialog().yesno(lang(30091), lang(33015), autoclose=120000) + resp = xbmcgui.Dialog().yesno( + lang(30091).encode('utf-8'), + lang(33015).encode('utf-8'), + autoclose=120000) if not resp: log("User skipped deletion.", 1) continue diff --git a/resources/lib/playlist.py b/resources/lib/playlist.py index 116921c5..9d0334ee 100644 --- a/resources/lib/playlist.py +++ b/resources/lib/playlist.py @@ -8,7 +8,6 @@ from urllib import urlencode import xbmc import xbmcgui -import playbackutils import embydb_functions as embydb import read_embyserver as embyserver import utils diff --git a/resources/lib/playutils.py b/resources/lib/playutils.py index 9aaa9516..8a382f1a 100644 --- a/resources/lib/playutils.py +++ b/resources/lib/playutils.py @@ -343,7 +343,7 @@ class PlayUtils(): #audioStreamsChannelsList[audioNum] = stream.attrib['channels'] audioStreamsList.append(index) - audioStreams.append(track) + audioStreams.append(track.encode('utf-8')) audioNum += 1 # Subtitles @@ -367,11 +367,11 @@ class PlayUtils(): downloadableStreams.append(index) subtitleStreamsList.append(index) - subtitleStreams.append(track) + subtitleStreams.append(track.encode('utf-8')) subNum += 1 if audioNum > 1: - resp = dialog.select(lang(33013), audioStreams) + resp = dialog.select(lang(33013).encode('utf-8'), audioStreams) if resp > -1: # User selected audio playurlprefs['audioStreamID'] = audioStreamsList[resp] @@ -384,7 +384,7 @@ class PlayUtils(): playurlprefs['audioBoost'] = utils.settings('audioBoost') if subNum > 1: - resp = dialog.select(lang(33014), subtitleStreams) + resp = dialog.select(lang(33014).encode('utf-8'), subtitleStreams) if resp == 0: # User selected no subtitles playurlprefs["skipSubtitles"] = 1 diff --git a/service.py b/service.py index 26dda9c1..0074b26e 100644 --- a/service.py +++ b/service.py @@ -171,9 +171,8 @@ class Service(): self.welcome_msg = False xbmcgui.Dialog().notification( heading=self.addonName, - message=("%s %s" - % (lang(33000).encode('utf-8'), - user.currUser.encode('utf-8'))), + message=("%s %s" % (lang(33000), user.currUser) + ).encode('utf-8'), icon="special://home/addons/plugin.video.plexkodiconnect/icon.png", time=2000, sound=False) @@ -227,7 +226,7 @@ class Service(): xbmcgui.Dialog().notification( heading=lang(33001).encode('utf-8'), - message="%s %s" % (self.addonName, lang(33002).encode('utf-8')), + message=("%s %s" % (self.addonName, lang(33002))).encode('utf-8'), icon="special://home/addons/plugin.video." "plexkodiconnect/icon.png", sound=False)