From 2f23824849643b60e24ca0f838efaad41d5e0727 Mon Sep 17 00:00:00 2001 From: kaliko Date: Tue, 23 Nov 2021 10:49:44 +0100 Subject: [PATCH] Set max_art default value to 20 --- doc/Changelog | 1 + doc/examples/all_settings.cfg | 2 +- doc/source/man/mpd_sima.cfg.5.rst | 2 +- sima/lib/webserv.py | 2 +- sima/utils/config.py | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/Changelog b/doc/Changelog index 7e772a7..409caed 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,6 +1,7 @@ MPD_sima v0.18.1.dev0 * Remove bad heuristic to infer artist aliases + * Set max_art default value to 20 * Add shpinx documentation * Merge unix manuals in sphinx reStructuredText Call "setup.py build_sphinx" to build troff manuals diff --git a/doc/examples/all_settings.cfg b/doc/examples/all_settings.cfg index 4ffcf1f..bb5f803 100644 --- a/doc/examples/all_settings.cfg +++ b/doc/examples/all_settings.cfg @@ -244,7 +244,7 @@ queue_mode = track # description: Number of similar artist to retrieve from local media library. # When set to something superior to zero, MPD_sima tries to get as much similar # artists from media library -max_art = 10 +max_art = 20 ## DEPTH # type: integer in [1, +∞] diff --git a/doc/source/man/mpd_sima.cfg.5.rst b/doc/source/man/mpd_sima.cfg.5.rst index df0b783..bc3dbda 100644 --- a/doc/source/man/mpd_sima.cfg.5.rst +++ b/doc/source/man/mpd_sima.cfg.5.rst @@ -227,7 +227,7 @@ LastFM plugin's configuration. Queue mode to use among track, top and album (see `QUEUE MODE section <#queue_mode>`__ for info about queue modes). -**max_art=0** +**max_art=20** Maximum number of similar artist to retrieve from local media library. When set to something superior to zero, it tries to get as diff --git a/sima/lib/webserv.py b/sima/lib/webserv.py index 18414e7..8201964 100644 --- a/sima/lib/webserv.py +++ b/sima/lib/webserv.py @@ -103,7 +103,7 @@ class WebService(AdvancedPlugin): dynamic = 100 results = [] similarities.reverse() - while (len(results) < dynamic and similarities): + while (len(results) < dynamic+1 and similarities): art_pop = similarities.pop() res = self.player.search_artist(art_pop) if res: diff --git a/sima/utils/config.py b/sima/utils/config.py index c89b591..caaac3e 100644 --- a/sima/utils/config.py +++ b/sima/utils/config.py @@ -71,7 +71,7 @@ DEFAULT_CONF = { }, 'lastfm': { 'queue_mode': "track", # TODO control values - 'max_art': 10, + 'max_art': 20, 'single_album': False, 'track_to_add': 1, 'album_to_add': 1, -- 2.39.5