diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index 94137806..9766267a 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -1557,6 +1557,11 @@ msgctxt "#39064" msgid "Recently Added: Also show already watched episodes" msgstr "" +# PKC settings, Appearance Tweaks +msgctxt "#39065" +msgid "Force-refresh Kodi skin on stopping playback" +msgstr "" + msgctxt "#39066" msgid "Recently Added: Also show already watched movies (Refresh Plex playlist/nodes!)" msgstr "" diff --git a/resources/lib/initialsetup.py b/resources/lib/initialsetup.py index 34544c47..279a4991 100644 --- a/resources/lib/initialsetup.py +++ b/resources/lib/initialsetup.py @@ -68,6 +68,7 @@ def reload_pkc(): state.REMAP_PATH = settings('remapSMB') == 'true' state.KODI_PLEX_TIME_OFFSET = float(settings('kodiplextimeoffset')) state.FETCH_PMS_ITEM_NUMBER = settings('fetch_pms_item_number') + state.FORCE_RELOAD_SKIN = settings('forceReloadSkin') == 'true' # Init some Queues() state.COMMAND_PIPELINE_QUEUE = Queue() state.COMPANION_QUEUE = Queue(maxsize=100) diff --git a/resources/lib/kodimonitor.py b/resources/lib/kodimonitor.py index 4ee9cb37..0109b2e0 100644 --- a/resources/lib/kodimonitor.py +++ b/resources/lib/kodimonitor.py @@ -47,6 +47,7 @@ STATE_SETTINGS = { 'remapSMBphotoOrg': 'remapSMBphotoOrg', 'remapSMBphotoNew': 'remapSMBphotoNew', 'enableMusic': 'ENABLE_MUSIC', + 'forceReloadSkin': 'FORCE_RELOAD_SKIN', 'fetch_pms_item_number': 'FETCH_PMS_ITEM_NUMBER' } diff --git a/resources/lib/player.py b/resources/lib/player.py index 43f772e8..a895577d 100644 --- a/resources/lib/player.py +++ b/resources/lib/player.py @@ -4,7 +4,7 @@ from logging import getLogger import copy -from xbmc import Player +import xbmc import kodidb_functions as kodidb import plexdb_functions as plexdb @@ -104,11 +104,16 @@ def _record_playstate(status, ended): totaltime, playcount, last_played) + # Hack to force "in progress" widget to appear if it wasn't visible before + if (state.FORCE_RELOAD_SKIN and + xbmc.getCondVisibility('Window.IsVisible(Home.xml)')): + LOG.debug('Refreshing skin to update widgets') + xbmc.executebuiltin('ReloadSkin()') -class PKC_Player(Player): +class PKC_Player(xbmc.Player): def __init__(self): - Player.__init__(self) + xbmc.Player.__init__(self) LOG.info("Started playback monitor.") def onPlayBackStarted(self): diff --git a/resources/lib/state.py b/resources/lib/state.py index b35cd5e7..3cdfa910 100644 --- a/resources/lib/state.py +++ b/resources/lib/state.py @@ -30,6 +30,8 @@ INDICATE_MEDIA_VERSIONS = False RUN_LIB_SCAN = None # Number of items to fetch and display in widgets FETCH_PMS_ITEM_NUMBER = None +# Hack to force Kodi widget for "in progress" to show up if it was empty before +FORCE_RELOAD_SKIN = True # Stemming from the PKC settings.xml # Shall we show Kodi dialogs when synching? diff --git a/resources/settings.xml b/resources/settings.xml index 0ef67089..953e6288 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -144,6 +144,7 @@ +