X-Git-Url: https://git.kaliko.me/?a=blobdiff_plain;f=sima%2Flib%2Fwebserv.py;h=ae540b7aacc1d94d5949754b6ccd20941b431579;hb=535ca42796e2785188482e2f4ee0cf3a277f8000;hp=ca6b1f095b9b2d6499c9a384ca73218a0f348338;hpb=af5f8a1cbde1e61ec1b44da676fae89c4358d184;p=mpd-sima.git diff --git a/sima/lib/webserv.py b/sima/lib/webserv.py index ca6b1f0..ae540b7 100644 --- a/sima/lib/webserv.py +++ b/sima/lib/webserv.py @@ -259,6 +259,8 @@ class WebService(AdvancedPlugin): continue nb_album_add += 1 candidates = self.player.find_tracks(album) + if not candidates: + continue if self.plugin_conf.getboolean('shuffle_album'): random.shuffle(candidates) # this allows to select a maximum number of track from the album @@ -278,7 +280,7 @@ class WebService(AdvancedPlugin): nbtracks_target = self.plugin_conf.getint('track_to_add') for artist in artists: if len(to_add) == nbtracks_target: - return to_add + break self.log.info('Looking for a top track for %s', artist) titles = deque() try: @@ -294,6 +296,7 @@ class WebService(AdvancedPlugin): if top_trk: to_add.append(top_trk) break + return to_add def _track(self): """Get some tracks for track queue mode