Revert "Revert "Fix for "In Progress" not appearing""

This reverts commit 303adbf02e.
This commit is contained in:
Croneter 2018-03-22 17:26:11 +01:00
parent baf60c2cc8
commit 22503657d2
6 changed files with 18 additions and 3 deletions

View File

@ -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 ""

View File

@ -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)

View File

@ -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'
}

View File

@ -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):

View File

@ -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?

View File

@ -144,6 +144,7 @@
<category label="39073"><!-- Appearance Tweaks -->
<setting id="fetch_pms_item_number" label="39077" type="number" default="25" option="int" />
<setting id="forceReloadSkin" type="bool" label="39065" default="true" /><!-- Force-refresh Kodi skin on stopping playback -->
<setting type="lsep" label="39074" /><!-- TV Shows -->
<setting id="OnDeckTVextended" type="bool" label="39058" default="true" /><!-- Extend Plex TV Series "On Deck" view to all shows -->
<setting id="OnDeckTvAppendShow" type="bool" label="39047" default="false" /><!--On Deck view: Append show title to episode-->