Skip to content

Commit

Permalink
logs/end_of_track (#124)
Browse files Browse the repository at this point in the history
make it easier to debug issues like  #123
  • Loading branch information
JarbasAl authored Aug 6, 2024
1 parent 7f98f71 commit b8f5202
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions ovos_plugin_common_play/ocp/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -769,10 +769,14 @@ def handle_invalid_media(self, message):
@require_native_source()
def handle_playback_ended(self, message):
# TODO: When we get here, self.active_backend has been reset!
if (self.settings.get("autoplay", True) and \
self.active_backend != PlaybackType.MPRIS and
len(self.playlist.entries)):
LOG.debug(f"Playing next (backend={repr(self.active_backend)}")
LOG.info(f"END OF MEDIA - playlist pos: {self.playlist.position} "
f"total tracks: {len(self.playlist)} "
f"backend: {self.active_backend}")
go_next = self.settings.get("autoplay", True) and \
self.active_backend != PlaybackType.MPRIS and \
self.playlist.position + 1 < len(self.playlist)
LOG.debug(f"Go to Next track: {go_next}")
if go_next:
self.play_next()
return
LOG.info("Playback ended")
Expand Down

0 comments on commit b8f5202

Please sign in to comment.