From 17fdf0e9237055d07215e0e41b2ebe18291dcf74 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Sat, 8 Sep 2018 16:50:46 -0500 Subject: [PATCH] Clear patch In the event the patch is borked, clear it and let the user know of this. --- resources/language/resource.language.en_gb/strings.po | 4 ++++ resources/lib/database/__init__.py | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index ec2f47ae..164907d7 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -749,3 +749,7 @@ msgstr "" msgctxt "#33154" msgid "Add libraries" msgstr "" + +msgctxt "#33155" +msgid "The currently applied patch for Emby for Kodi is corrupted! Please post to the Emby for Kodi forums if this issue persists. This will need to be fixed as soon as possible." +msgstr "" diff --git a/resources/lib/database/__init__.py b/resources/lib/database/__init__.py index 99e9fff0..d137b8a1 100644 --- a/resources/lib/database/__init__.py +++ b/resources/lib/database/__init__.py @@ -12,8 +12,8 @@ import xbmc import xbmcvfs import emby_db +from helper.utils import delete_folder from helper import _, settings, window, dialog -from objects import obj ################################################################################################# @@ -21,6 +21,15 @@ LOG = logging.getLogger("EMBY."+__name__) ################################################################################################# +try: + from objects import obj +except Exception as error: + # clear patch + LOG.exception(error) + delete_folder() + dialog("ok", heading="{emby}", line1=_(33155)) + xbmc.executebuiltin('RestartApp') + class Database(object):