Merge branch 'master' into 'master'

Add check for whether to queue the currently playing album (close #78)

Closes #78

See merge request coderkun/mcg!1
This commit is contained in:
Oenometer 2020-10-24 14:04:51 +00:00
commit 9de629bfed

View file

@ -611,6 +611,10 @@ class Client(Base):
def _queue_album(self, album):
track_ids = []
# check whether the album to queue is already the last in the playlist
if self._playlist and self._playlist[-1] == self._albums[album]:
# return the first song in the album
return [self._playlist[-1].get_tracks()[0].get_id()]
if album in self._albums:
self._logger.info("add album %s", album)
for track in self._albums[album].get_tracks():