Skip to content

Commit ecdff78

Browse files
authored
Only output verbose details for parentwork plugin when running explicitly (#5135)
Fixes #4120.
1 parent 5d010e9 commit ecdff78

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

beetsplug/parentwork.py

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def func(lib, opts, args):
8989
write = ui.should_write()
9090

9191
for item in lib.items(ui.decargs(args)):
92-
changed = self.find_work(item, force_parent)
92+
changed = self.find_work(item, force_parent, verbose=True)
9393
if changed:
9494
item.store()
9595
if write:
@@ -116,7 +116,7 @@ def imported(self, session, task):
116116
force_parent = self.config["force"].get(bool)
117117

118118
for item in task.imported_items():
119-
self.find_work(item, force_parent)
119+
self.find_work(item, force_parent, verbose=False)
120120
item.store()
121121

122122
def get_info(self, item, work_info):
@@ -165,7 +165,7 @@ def get_info(self, item, work_info):
165165

166166
return parentwork_info
167167

168-
def find_work(self, item, force):
168+
def find_work(self, item, force, verbose):
169169
"""Finds the parent work of a recording and populates the tags
170170
accordingly.
171171
@@ -221,16 +221,17 @@ def find_work(self, item, force):
221221

222222
if work_date:
223223
item["work_date"] = work_date
224-
return ui.show_model_changes(
225-
item,
226-
fields=[
227-
"parentwork",
228-
"parentwork_disambig",
229-
"mb_parentworkid",
230-
"parent_composer",
231-
"parent_composer_sort",
232-
"work_date",
233-
"parentwork_workid_current",
234-
"parentwork_date",
235-
],
236-
)
224+
if verbose:
225+
return ui.show_model_changes(
226+
item,
227+
fields=[
228+
"parentwork",
229+
"parentwork_disambig",
230+
"mb_parentworkid",
231+
"parent_composer",
232+
"parent_composer_sort",
233+
"work_date",
234+
"parentwork_workid_current",
235+
"parentwork_date",
236+
],
237+
)

docs/changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ Bug fixes:
8383
lyrics.
8484
:bug:`5583`
8585
* ImageMagick 7.1.1-44 is now supported.
86+
* :doc:`plugins/parentwork`: Only output parentwork changes when running in verbose mode.
8687

8788
For packagers:
8889

0 commit comments

Comments
 (0)