From 600a22d158d9fc5b9c9ed85c9478dcbd4c8ec188 Mon Sep 17 00:00:00 2001 From: croneter Date: Fri, 16 Mar 2018 07:37:27 +0100 Subject: [PATCH] Fix for "In Progress" not appearing - Partially fixes #428 --- resources/language/resource.language.en_gb/strings.po | 5 +++++ resources/lib/initialsetup.py | 1 + resources/lib/kodimonitor.py | 1 + resources/lib/player.py | 11 ++++++++--- resources/lib/state.py | 2 ++ resources/settings.xml | 1 + 6 files changed, 18 insertions(+), 3 deletions(-) diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index 939dfbcd..865dc6fd 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -1560,6 +1560,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 651c3946..e54f5362 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 023b4eff..040e7b44 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 @@ +