diff --git a/script.service.checkpreviousepisode/addon.xml b/script.service.checkpreviousepisode/addon.xml index 0b7638d24..7ff8e12ec 100644 --- a/script.service.checkpreviousepisode/addon.xml +++ b/script.service.checkpreviousepisode/addon.xml @@ -1,5 +1,5 @@ - + @@ -16,9 +16,7 @@ https://forum.kodi.tv/showthread.php?tid=355464 https://kodi.wiki/view/Add-on:XBMC_Check_Previous_Episode https://github.com/bossanova808/script.service.checkpreviousepisode - v0.4.6 - - Ignore shows that have already been decided on (i.e. those with a non-zero resume point) - + v0.4.7 Add Window Property so skinners can dress up the dialog icon.png diff --git a/script.service.checkpreviousepisode/changelog.txt b/script.service.checkpreviousepisode/changelog.txt index 89b340b44..e7869bc3f 100644 --- a/script.service.checkpreviousepisode/changelog.txt +++ b/script.service.checkpreviousepisode/changelog.txt @@ -1,3 +1,6 @@ +v0.4.7 +- Add Window Property so skinners can dress up the dialog + v0.4.6 - Ignore shows that have already been decided on (i.e. those with a non-zero resume point) diff --git a/script.service.checkpreviousepisode/resources/lib/common.py b/script.service.checkpreviousepisode/resources/lib/common.py index a86a1eeec..6e7b9f1de 100644 --- a/script.service.checkpreviousepisode/resources/lib/common.py +++ b/script.service.checkpreviousepisode/resources/lib/common.py @@ -1,11 +1,23 @@ # -*- coding: utf-8 -*- + """ -Handy utility functions for Kodi Addons -By bossanova808 -Free in all senses.... -VERSION 0.2.4 2021-08-10 -(For Kodi Matrix & later) + +Handy utility functions & constants for Kodi Addons +For Kodi Matrix & later +By bossanova808 - freely released +VERSION 0.2.7 2024-04-19 + +Changelog: +0.2.7 - Fix getting the major Kodi version (& change float -> int), as it was failing on e.g. 'RC' being in the string apparently +0.2.6 - (SkinPatcher) - add float KODI_VERSION_FLOAT constant, alongside string KODI_VERSION +0.2.5 - (Skin) - move to storing copy of latest in bossanova808 repo and adding this mini changelog + +For latest version - ALWAYS COPY BACK ANY CHANGES, plus do changelog, and a version & date bump above: +https://github.com/bossanova808/repository.bossanova808/blob/main/latest-common/common.py + + """ + import sys import traceback @@ -27,6 +39,7 @@ LANGUAGE = ADDON.getLocalizedString PROFILE = xbmcvfs.translatePath(ADDON.getAddonInfo('profile')) KODI_VERSION = xbmc.getInfoLabel('System.BuildVersion') +KODI_VERSION_INT = int(KODI_VERSION.split(".")[0]) USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36" HOME_WINDOW = xbmcgui.Window(10000) WEATHER_WINDOW = xbmcgui.Window(12600) @@ -51,6 +64,8 @@ """ unit_testing = False + +# Testing outside of Kodi if not xbmc.getUserAgent(): xbmc = None @@ -65,6 +80,7 @@ def log(message, exception_instance=None, level=None): print(f'EXCPT: {traceback.format_exc(exception_instance)}') +# Running inside of Kodi else: def log(message, exception_instance=None, level=xbmc.LOGDEBUG): @@ -192,7 +208,7 @@ def footprints(startup=True): """ if startup: log(f'Starting...', level=xbmc.LOGINFO) - log(f'Kodi Version: {KODI_VERSION}', level=xbmc.LOGINFO) + log(f'Kodi System.BuildVersion: {KODI_VERSION}, which is Kodi major version: {KODI_VERSION_INT}', level=xbmc.LOGINFO) log(f'Addon arguments: {ADDON_ARGUMENTS}', level=xbmc.LOGINFO) else: log(f'Exiting...', level=xbmc.LOGINFO) diff --git a/script.service.checkpreviousepisode/resources/lib/monitor.py b/script.service.checkpreviousepisode/resources/lib/monitor.py index b17d6c6d0..a8f67e03e 100644 --- a/script.service.checkpreviousepisode/resources/lib/monitor.py +++ b/script.service.checkpreviousepisode/resources/lib/monitor.py @@ -15,4 +15,3 @@ def onSettingsChanged(self): def onAbortRequested(self): log('onAbortRequested') - log("Abort Requested") \ No newline at end of file diff --git a/script.service.checkpreviousepisode/resources/lib/player.py b/script.service.checkpreviousepisode/resources/lib/player.py index d0b584dec..d098bfef3 100644 --- a/script.service.checkpreviousepisode/resources/lib/player.py +++ b/script.service.checkpreviousepisode/resources/lib/player.py @@ -125,7 +125,10 @@ def onAVStarted(self): log("Prior episode not watched! -> pausing playback") self.pause() + # Set a window property per Hitcher's request - https://forum.kodi.tv/showthread.php?tid=355464&pid=3191615#pid3191615 + HOME_WINDOW.setProperty("CheckPreviousEpisode", "MissingPreviousEpisode") result = xbmcgui.Dialog().select(LANGUAGE(32020), [LANGUAGE(32021), LANGUAGE(32022), LANGUAGE(32023)], preselect=0) + HOME_WINDOW.setProperty("CheckPreviousEpisode", "") # User has requested we ignore this particular show from now on... if result == 2: