From 20e811c88287ed0aa13883cf36ce3621bab4ae96 Mon Sep 17 00:00:00 2001 From: Roman Miroshnychenko Date: Wed, 25 Dec 2024 15:13:31 +0200 Subject: [PATCH] Refresh media list after updating playback state --- plugin.video.external.library/libs/monitor.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugin.video.external.library/libs/monitor.py b/plugin.video.external.library/libs/monitor.py index 85b835f..3f0cb04 100644 --- a/plugin.video.external.library/libs/monitor.py +++ b/plugin.video.external.library/libs/monitor.py @@ -58,12 +58,12 @@ def onPlayBackStarted(self): logger.debug('Started monitoring %s', self._playing_file) def onPlayBackStopped(self): - self._send_played_file_state() + self._send_played_file_state(should_refresh_list=True) logger.debug('Stopped monitoring %s. Playback stopped.', self._playing_file) self._clear_state() def onPlayBackEnded(self): - self._send_played_file_state() + self._send_played_file_state(should_refresh_list=True) logger.debug('Stopped monitoring %s. Playback ended.', self._playing_file) self._clear_state() @@ -115,8 +115,10 @@ def _send_resume(self): json_rpc_api.update_resume(item_id_param, self._item_info[item_id_param], self._current_time, self._total_time) - def _send_played_file_state(self): + def _send_played_file_state(self, should_refresh_list=False): if self._should_send_playcount(): self._send_playcount() elif self._should_send_resume(): self._send_resume() + if should_refresh_list: + xbmc.executebuiltin('Container.Refresh')