From ecdff785f79f4bca04bcbfcf055e61d892126bf5 Mon Sep 17 00:00:00 2001 From: Aidan Epstein Date: Sun, 4 May 2025 00:34:37 -0700 Subject: [PATCH] Only output verbose details for parentwork plugin when running explicitly (#5135) Fixes #4120. --- beetsplug/parentwork.py | 33 +++++++++++++++++---------------- docs/changelog.rst | 1 + 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/beetsplug/parentwork.py b/beetsplug/parentwork.py index 26f8f224f..463a455f5 100644 --- a/beetsplug/parentwork.py +++ b/beetsplug/parentwork.py @@ -89,7 +89,7 @@ class ParentWorkPlugin(BeetsPlugin): write = ui.should_write() for item in lib.items(ui.decargs(args)): - changed = self.find_work(item, force_parent) + changed = self.find_work(item, force_parent, verbose=True) if changed: item.store() if write: @@ -116,7 +116,7 @@ class ParentWorkPlugin(BeetsPlugin): force_parent = self.config["force"].get(bool) for item in task.imported_items(): - self.find_work(item, force_parent) + self.find_work(item, force_parent, verbose=False) item.store() def get_info(self, item, work_info): @@ -165,7 +165,7 @@ class ParentWorkPlugin(BeetsPlugin): return parentwork_info - def find_work(self, item, force): + def find_work(self, item, force, verbose): """Finds the parent work of a recording and populates the tags accordingly. @@ -221,16 +221,17 @@ add one at https://musicbrainz.org/recording/{}", if work_date: item["work_date"] = work_date - return ui.show_model_changes( - item, - fields=[ - "parentwork", - "parentwork_disambig", - "mb_parentworkid", - "parent_composer", - "parent_composer_sort", - "work_date", - "parentwork_workid_current", - "parentwork_date", - ], - ) + if verbose: + return ui.show_model_changes( + item, + fields=[ + "parentwork", + "parentwork_disambig", + "mb_parentworkid", + "parent_composer", + "parent_composer_sort", + "work_date", + "parentwork_workid_current", + "parentwork_date", + ], + ) diff --git a/docs/changelog.rst b/docs/changelog.rst index e52f329b0..1ab7229e7 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -83,6 +83,7 @@ Bug fixes: lyrics. :bug:`5583` * ImageMagick 7.1.1-44 is now supported. +* :doc:`plugins/parentwork`: Only output parentwork changes when running in verbose mode. For packagers: