]> kaliko git repositories - mpd-sima.git/blobdiff - sima/lib/webserv.py
Cleanup Exceptions
[mpd-sima.git] / sima / lib / webserv.py
index ca6b1f095b9b2d6499c9a384ca73218a0f348338..ae540b7aacc1d94d5949754b6ccd20941b431579 100644 (file)
@@ -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