From 7754dd27c548e02dcdae9fd3613c8cc8e42dacdf Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Sep 2019 20:15:35 -0400 Subject: [PATCH 1/3] Make none_rec_action respect timid. #3242 --- beets/ui/commands.py | 4 ++++ docs/changelog.rst | 3 +++ 2 files changed, 7 insertions(+) diff --git a/beets/ui/commands.py b/beets/ui/commands.py index 57b627c77..e89a58bc1 100755 --- a/beets/ui/commands.py +++ b/beets/ui/commands.py @@ -481,6 +481,7 @@ def _summary_judgment(rec): queried. May also print to the console if a summary judgment is made. """ + print(rec) if config['import']['quiet']: if rec == Recommendation.strong: return importer.action.APPLY @@ -496,6 +497,9 @@ def _summary_judgment(rec): 'asis': importer.action.ASIS, 'ask': None, }) + # prompt the user if timid is enabled + if config['import']['timid'] and action == importer.action.ASIS: + return None else: return None diff --git a/docs/changelog.rst b/docs/changelog.rst index 690696c1d..da1948758 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -97,6 +97,9 @@ Fixes: * Fixed a bug that caused the UI to display incorrect track numbers for tracks with index 0 when the ``per_disc_numbering`` option was set. :bug:`3346` +* ``none_rec_action`` does not import automatically when ``timid`` is enabled. + Thanks to :user:`RollingStar`. + :bug:`3242` For plugin developers: From 80e51027e6fea955c39b239ebcba1692e8d0200f Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Sep 2019 20:17:00 -0400 Subject: [PATCH 2/3] remove debug line --- beets/ui/commands.py | 1 - 1 file changed, 1 deletion(-) diff --git a/beets/ui/commands.py b/beets/ui/commands.py index e89a58bc1..13e431b4b 100755 --- a/beets/ui/commands.py +++ b/beets/ui/commands.py @@ -481,7 +481,6 @@ def _summary_judgment(rec): queried. May also print to the console if a summary judgment is made. """ - print(rec) if config['import']['quiet']: if rec == Recommendation.strong: return importer.action.APPLY From c9468350ec9e3a0942177ef9a54b1b0bec39db2f Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 7 Sep 2019 11:49:54 -0400 Subject: [PATCH 3/3] Timid always prompts. Clarify docstring. --- beets/ui/commands.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/beets/ui/commands.py b/beets/ui/commands.py index 13e431b4b..7941be46b 100755 --- a/beets/ui/commands.py +++ b/beets/ui/commands.py @@ -477,10 +477,11 @@ def summarize_items(items, singleton): def _summary_judgment(rec): """Determines whether a decision should be made without even asking the user. This occurs in quiet mode and when an action is chosen for - NONE recommendations. Return an action or None if the user should be - queried. May also print to the console if a summary judgment is - made. + NONE recommendations. Return None if the user should be queried. + Otherwise, returns an action. May also print to the console if a + summary judgment is made. """ + if config['import']['quiet']: if rec == Recommendation.strong: return importer.action.APPLY @@ -489,17 +490,14 @@ def _summary_judgment(rec): 'skip': importer.action.SKIP, 'asis': importer.action.ASIS, }) - + elif config['import']['timid']: + return None elif rec == Recommendation.none: action = config['import']['none_rec_action'].as_choice({ 'skip': importer.action.SKIP, 'asis': importer.action.ASIS, 'ask': None, }) - # prompt the user if timid is enabled - if config['import']['timid'] and action == importer.action.ASIS: - return None - else: return None