Skip to content

Commit

Permalink
fix/legacy_playlist_queue
Browse files Browse the repository at this point in the history
bug: queueing new tracks always replaced old playlist

detected in end2end tests from OpenVoiceOS/ovos-audio#64
  • Loading branch information
JarbasAl committed May 11, 2024
1 parent 801d26b commit 5312d53
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions ovos_plugin_manager/templates/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,10 @@ def add_list(self, tracks):
tracks = [tracks]
elif not isinstance(tracks, list):
raise ValueError
if tracks:
if tracks and not self._tracks:
self.load_track(tracks[0])
self._idx = 0
else:
LOG.error("called add_list without tracks!")
self._tracks = tracks
self._tracks += tracks

def next(self):
"""Skip to next track in playlist."""
Expand Down Expand Up @@ -340,7 +338,7 @@ def load_track(self, uri):
self._now_playing = uri
LOG.debug(f"queuing for {self.__class__.__name__} playback: {uri}")
self.bus.emit(Message("ovos.common_play.media.state",
{"state": MediaState.LOADED_MEDIA}))
{"state": MediaState.LOADING_MEDIA}))
self.bus.emit(Message("ovos.common_play.track.state", {
"state": TrackState.QUEUED_AUDIOSERVICE
}))
Expand Down

0 comments on commit 5312d53

Please sign in to comment.