bypass cache and request new data when playback stops

This commit is contained in:
faush01
2018-11-13 14:46:28 +11:00
parent 469e54f202
commit e28365da15
2 changed files with 15 additions and 1 deletions

View File

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

View File

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