]> kaliko git repositories - mpd-sima.git/commitdiff
Add random.shuffle to track list
authorkaliko <kaliko@azylum.org>
Thu, 26 Jun 2014 11:17:41 +0000 (13:17 +0200)
committerkaliko <kaliko@azylum.org>
Thu, 26 Jun 2014 11:17:41 +0000 (13:17 +0200)
sima/lib/webserv.py

index 5e787856414e69bd8e50111f03cbb4d8428ef805..30a7eac376bf8b8d0b40a12635d8d055dd8f32ec 100644 (file)
@@ -326,6 +326,7 @@ class WebService(Plugin):
                 self.log.info('{0.name} ratelimit: {0.ratelimit}'.format(self.ws))
             for trk in titles:
                 found = self.player.fuzzy_find_track(artist.name, trk.title)
+                random.shuffle(found)
                 if found:
                     self.log.debug('{0}'.format(found[0]))
                     if self.filter_track(found):
@@ -340,6 +341,7 @@ class WebService(Plugin):
             self.log.debug('Trying to find titles to add for "{}"'.format(
                            artist))
             found = self.player.find_track(artist)
+            random.shuffle(found)
             if not found:
                 self.log.debug('Found nothing to queue for {0}'.format(artist))
                 continue