From d91a3e0fba601661081c3557100a04bd7208feac Mon Sep 17 00:00:00 2001 From: J0J0 Todos Date: Tue, 16 May 2023 06:50:21 +0200 Subject: [PATCH 1/5] Show details in resolve_duplicates prompt --- beets/ui/commands.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/beets/ui/commands.py b/beets/ui/commands.py index 750457234e..ff92d1f1ff 100755 --- a/beets/ui/commands.py +++ b/beets/ui/commands.py @@ -872,11 +872,15 @@ def resolve_duplicate(self, task, found_duplicates): list(duplicate.items()) if task.is_album else [duplicate], not task.is_album, )) + for dup in duplicate.items(): + print(f" {dup}") print_("New: " + summarize_items( task.imported_items(), not task.is_album, )) + for item in task.imported_items(): + print(f" {item}") sel = ui.input_options( ('Skip new', 'Keep all', 'Remove old', 'Merge all') From 245d77718573dc087ce3750f7cf0128788bbf848 Mon Sep 17 00:00:00 2001 From: J0J0 Todos Date: Mon, 31 Jul 2023 11:34:17 +0200 Subject: [PATCH 2/5] Make verbose duplicates prompt configurable --- beets/config_default.yaml | 1 + beets/ui/commands.py | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/beets/config_default.yaml b/beets/config_default.yaml index dcb244bbd3..db9f985ec8 100644 --- a/beets/config_default.yaml +++ b/beets/config_default.yaml @@ -31,6 +31,7 @@ import: album: albumartist album item: artist title duplicate_action: ask + duplicate_verbose_prompt: no bell: no set_fields: {} ignored_alias_types: [] diff --git a/beets/ui/commands.py b/beets/ui/commands.py index ff92d1f1ff..9fdd4b166b 100755 --- a/beets/ui/commands.py +++ b/beets/ui/commands.py @@ -872,15 +872,17 @@ def resolve_duplicate(self, task, found_duplicates): list(duplicate.items()) if task.is_album else [duplicate], not task.is_album, )) - for dup in duplicate.items(): - print(f" {dup}") + if config['import']['duplicate_verbose_prompt']: + for dup in duplicate.items(): + print(f" {dup}") print_("New: " + summarize_items( task.imported_items(), not task.is_album, )) - for item in task.imported_items(): - print(f" {item}") + if config['import']['duplicate_verbose_prompt']: + for item in task.imported_items(): + print(f" {item}") sel = ui.input_options( ('Skip new', 'Keep all', 'Remove old', 'Merge all') From 38f30b2c1358cf05a5f89023333418c3584fc736 Mon Sep 17 00:00:00 2001 From: J0J0 Todos Date: Mon, 31 Jul 2023 16:40:43 +0200 Subject: [PATCH 3/5] Handle singletons in duplicate verbose prompt --- beets/ui/commands.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/beets/ui/commands.py b/beets/ui/commands.py index 9fdd4b166b..abe368bb58 100755 --- a/beets/ui/commands.py +++ b/beets/ui/commands.py @@ -873,8 +873,11 @@ def resolve_duplicate(self, task, found_duplicates): not task.is_album, )) if config['import']['duplicate_verbose_prompt']: - for dup in duplicate.items(): - print(f" {dup}") + if task.is_album: + for dup in duplicate.items(): + print(f" {dup}") + else: + print(f" {duplicate}") print_("New: " + summarize_items( task.imported_items(), From cd2db68d071d1e2ec350ba4fcaa58e8d806be6e6 Mon Sep 17 00:00:00 2001 From: J0J0 Todos Date: Wed, 23 Aug 2023 07:55:20 +0200 Subject: [PATCH 4/5] Add changelog for #4866 --- docs/changelog.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index ee8f4c2f61..7fdb9ed226 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -109,6 +109,9 @@ New features: :bug: `4863` * Make ArtResizer work with :pypi:`PIL`/:pypi:`pillow` 10.0.0 removals. :bug:`4869` +* A new configuration option, :ref:`duplicate_verbose_prompt`, allows changing + how duplicates are presented during import. + :bug: `4866` Bug fixes: From ef5c4de225da2834507eab22eadcd743a494d68f Mon Sep 17 00:00:00 2001 From: J0J0 Todos Date: Tue, 1 Aug 2023 12:06:17 +0200 Subject: [PATCH 5/5] Add docs for duplicate_verbose_prompt option in #4866 --- docs/reference/config.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/reference/config.rst b/docs/reference/config.rst index c870c87d94..56ed835a1d 100644 --- a/docs/reference/config.rst +++ b/docs/reference/config.rst @@ -728,6 +728,29 @@ Controls how duplicates are treated in import task. item; "merge" means merge into one album; "ask" means the user should be prompted for the action each time. The default is ``ask``. +.. _duplicate_verbose_prompt: + +duplicate_verbose_prompt +~~~~~~~~~~~~~~~~~~~~~~~~ + +Usually when duplicates are detected during import, information about the +existing and the newly imported album is summarized. Enabling this option also +lists details on individual tracks. The :ref:`format_item setting +` is applied, which would, considering the default, look like +this: + +.. code-block:: console + + This item is already in the library! + Old: 1 items, MP3, 320kbps, 5:56, 13.6 MiB + Artist Name - Album Name - Third Track Title + New: 2 items, MP3, 320kbps, 7:18, 17.1 MiB + Artist Name - Album Name - First Track Title + Artist Name - Album Name - Second Track Title + [S]kip new, Keep all, Remove old, Merge all? + +Default: ``no``. + .. _bell: bell