Skip to content

Commit

Permalink
[script.timers] 3.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Heckie75 committed Jul 21, 2024
1 parent 51ea9ed commit 037d95c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
5 changes: 4 additions & 1 deletion script.timers/addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.timers" name="Timers" version="3.9.1" provider-name="Heckie">
<addon id="script.timers" name="Timers" version="3.9.2" provider-name="Heckie">
<requires>
<import addon="xbmc.python" version="3.0.0" />
</requires>
Expand Down Expand Up @@ -66,6 +66,9 @@
<website>https://github.com/Heckie75/kodi-addon-timers</website>
<source>https://github.com/Heckie75/kodi-addon-timers</source>
<news>
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

Expand Down
16 changes: 12 additions & 4 deletions script.timers/resources/lib/player/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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:

Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 037d95c

Please sign in to comment.