]> kaliko git repositories - mpd-sima.git/commitdiff
Fixed crash when player.search_track returns nothing
authorkaliko <kaliko@azylum.org>
Tue, 29 Jun 2021 07:44:22 +0000 (09:44 +0200)
committerkaliko <kaliko@azylum.org>
Tue, 29 Jun 2021 07:44:22 +0000 (09:44 +0200)
sima/lib/webserv.py

index a0b899a3f624f82fdbc2f1b45f9e956574b82d9b..ae540b7aacc1d94d5949754b6ccd20941b431579 100644 (file)
@@ -280,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:
@@ -296,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