From d0b8cae7749cabd9b97c8b65f7c688c62fb9b2d3 Mon Sep 17 00:00:00 2001 From: kaliko Date: Fri, 19 Feb 2021 18:32:53 +0100 Subject: [PATCH] Add randomness in Tags plugin artist selection --- doc/Changelog | 1 + sima/plugins/internal/tags.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/doc/Changelog b/doc/Changelog index 8b0ebf9..b8ed55c 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,5 +1,6 @@ MPD_sima v0.16.2.dev0 + * Add randomness in Tags plugin artist selection * Fixed issue with un-tagged titles (closes #40) * Fixed "artist with quotes not found" (closes #41) diff --git a/sima/plugins/internal/tags.py b/sima/plugins/internal/tags.py index ef95606..3b7ffb0 100644 --- a/sima/plugins/internal/tags.py +++ b/sima/plugins/internal/tags.py @@ -22,6 +22,7 @@ Add titles based on tags """ # standard library import +import random # third parties components from musicpd import CommandError @@ -115,6 +116,7 @@ class Tags(AdvancedPlugin): target = self.plugin_conf.getint(f'{queue_mode}_to_add') # look for artists acording to filter artists = MetaContainer([Artist(name=a) for a in self.player.list('artist', self.mpd_filter)]) + random.shuffle(artists) if not artists: self.log.info('Tags plugin found nothing to queue') return candidates -- 2.39.5