From e28365da154ae3ee68d4e90bb63d34baf1198682 Mon Sep 17 00:00:00 2001 From: faush01 Date: Tue, 13 Nov 2018 14:46:28 +1100 Subject: [PATCH] bypass cache and request new data when playback stops --- resources/lib/datamanager.py | 7 +++++++ resources/lib/play_utils.py | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/resources/lib/datamanager.py b/resources/lib/datamanager.py index 45fbc18..bbe4f86 100644 --- a/resources/lib/datamanager.py +++ b/resources/lib/datamanager.py @@ -36,6 +36,7 @@ class DataManager(): def get_items(self, url, gui_options, use_cache=False): home_window = HomeWindow() + home_window.setProperty("last_content_url", url) user_id = DownloadUtils().getUserId() @@ -54,6 +55,12 @@ class DataManager(): home_window.setProperty(cache_file, "true") + clear_cache = home_window.getProperty(url) + if clear_cache and os.path.isfile(cache_file): + log.debug("Clearing cache data and loading new data") + home_window.clearProperty(url) + os.remove(cache_file) + if os.path.isfile(cache_file) and use_cache: log.debug("Loading url data from pickle data") diff --git a/resources/lib/play_utils.py b/resources/lib/play_utils.py index 96c7fd2..8133043 100644 --- a/resources/lib/play_utils.py +++ b/resources/lib/play_utils.py @@ -114,6 +114,11 @@ def playFile(play_info, monitor): id = play_info.get("item_id") + home_window = HomeWindow() + last_url = home_window.getProperty("last_content_url") + if last_url: + home_window.setProperty(last_url, "true") + # if this is a list of items them add them all to the play list if isinstance(id, list): return playListOfItems(id, monitor) @@ -803,7 +808,9 @@ def promptForStopActions(item_id, current_possition): play_info["force_transcode"] = False send_event_notification("embycon_play_action", play_info) - xbmc.executebuiltin("Container.Refresh") + else: + xbmc.executebuiltin("Container.Refresh") + def stopAll(played_information): if len(played_information) == 0: