diff --git a/resources/lib/objects/__init__.py b/resources/lib/objects/__init__.py index 9300934d..6d3c8152 100644 --- a/resources/lib/objects/__init__.py +++ b/resources/lib/objects/__init__.py @@ -6,5 +6,6 @@ from obj import Objects from actions import Actions from actions import PlaylistWorker from actions import on_play, on_update, special_listener +import utils Objects().mapping() diff --git a/resources/lib/objects/actions.py b/resources/lib/objects/actions.py index 2939db9c..3fd3f71a 100644 --- a/resources/lib/objects/actions.py +++ b/resources/lib/objects/actions.py @@ -17,7 +17,6 @@ from downloader import TheVoid from obj import Objects from helper import _, playutils, api, window, settings, dialog from dialogs import resume -from utils import get_play_action ################################################################################################# @@ -94,17 +93,13 @@ class Actions(object): if item['MediaType'] in ('Video', 'Audio'): resume = item['UserData'].get('PlaybackPositionTicks') - if resume: - if get_play_action() == "Resume": - seektime = True + if resume and transcode and not seektime: + choice = self.resume_dialog(api.API(item, self.server).adjust_resume((resume or 0) / 10000000.0)) - if transcode and not seektime: - choice = self.resume_dialog(api.API(item, self.server).adjust_resume((resume or 0) / 10000000.0)) + if choice is None: + raise Exception("User backed out of resume dialog.") - if choice is None: - raise Exception("User backed out of resume dialog.") - - seektime = False if not choice else True + seektime = False if not choice else True if settings('enableCinema.bool') and not seektime: self._set_intros(item) diff --git a/resources/lib/objects/utils.py b/resources/lib/objects/utils.py index c0bfadcf..f0da50c8 100644 --- a/resources/lib/objects/utils.py +++ b/resources/lib/objects/utils.py @@ -13,21 +13,6 @@ LOG = logging.getLogger("JELLYFIN." + __name__) ################################################################################################# -def get_play_action(): - - ''' I could not figure out a way to listen to kodi setting changes? - For now, verify the play action every time play is called. - ''' - options = ['Choose', 'Play', 'Resume', 'Show information'] - result = JSONRPC('Settings.GetSettingValue').execute({'setting': "myvideos.selectaction"}) - try: - return options[result['result']['value']] - except Exception as error: - LOG.exception("Returning play action due to error: %s", error) - - return options[1] - - def get_grouped_set(): ''' Get if boxsets should be grouped