From 037d95c5cb1161acb8846ba310f54cb08fc3500c Mon Sep 17 00:00:00 2001 From: Heckie75 Date: Sun, 21 Jul 2024 09:44:07 +0200 Subject: [PATCH] [script.timers] 3.9.2 --- script.timers/addon.xml | 5 ++++- script.timers/resources/lib/player/player.py | 16 ++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/script.timers/addon.xml b/script.timers/addon.xml index 63341097f..b5c0f1993 100644 --- a/script.timers/addon.xml +++ b/script.timers/addon.xml @@ -1,5 +1,5 @@ - + @@ -66,6 +66,9 @@ https://github.com/Heckie75/kodi-addon-timers https://github.com/Heckie75/kodi-addon-timers +v3.9.2 (2024-07-21) +- Bugfix: The repeat flag in Timer Addon doesn't work, issue #39 + v3.9.1 (2024-06-30) - Bugfix: Prevent exception after changing already running non-fading-timer to fading-timer diff --git a/script.timers/resources/lib/player/player.py b/script.timers/resources/lib/player/player.py index 4552e94ed..218206ac7 100644 --- a/script.timers/resources/lib/player/player.py +++ b/script.timers/resources/lib/player/player.py @@ -35,6 +35,8 @@ def __init__(self) -> None: self._resume_status: 'dict[PlayerStatus]' = dict() self._running_stop_at_end_timer: 'tuple[Timer, bool]' = (None, False) + + self.__is_unit_test__: bool = False def playTimer(self, timer: Timer, dtd: datetime_utils.DateTimeDelta) -> None: @@ -122,11 +124,15 @@ def _playAV(self, playlist: PlayList, startpos=0, seektime=None, repeat=player_u if playlist.getPlayListId() == TYPES.index(VIDEO): self.stopPlayer(PICTURE) + xbmc.executebuiltin("CECActivateSource") + + if self.__is_unit_test__: + self.setRepeat(repeat) + + self.play(playlist.directUrl or playlist, startpos=startpos) self.setRepeat(repeat) self.setShuffled(shuffled) self.setSpeed(speed) - xbmc.executebuiltin("CECActivateSource") - self.play(playlist.directUrl or playlist, startpos=startpos) def _playSlideShow(self, path: str, beginSlide=None, shuffle=False, amount=0) -> None: @@ -172,7 +178,8 @@ def onPlayBackStopped(self) -> None: _rst = self._running_stop_at_end_timer self._reset() if _rst[0] and not _rst[1]: - xbmc.log("set timer to be already stopped: %s" % str(_rst[0]), xbmc.LOGINFO) + xbmc.log("set timer to be already stopped: %s" % + str(_rst[0]), xbmc.LOGINFO) self._running_stop_at_end_timer = (_rst[0], True) showNotification(_rst[0], msg_id=32289) @@ -212,7 +219,8 @@ def resumeFormerOrStop(self, timer: Timer) -> None: elif timer != self._running_stop_at_end_timer[0] or not self._running_stop_at_end_timer[1]: self.stop() else: - xbmc.log("Skip timer's stop action since timer's playback has already been stopped by user: %s" % str(self._running_stop_at_end_timer[0]), xbmc.LOGINFO) + xbmc.log("Skip timer's stop action since timer's playback has already been stopped by user: %s" % str( + self._running_stop_at_end_timer[0]), xbmc.LOGINFO) self._reset(type=timer.media_type) xbmc.sleep(self._RESPITE)