Skip to content

Commit

Permalink
Only output verbose details for parentwork plugin when running explic…
Browse files Browse the repository at this point in the history
…itly.

Fixes #4120.
  • Loading branch information
aereaux committed Mar 4, 2024
1 parent 16e4bc3 commit 1790451
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions beetsplug/parentwork.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def func(lib, opts, args):
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:
Expand All @@ -117,7 +117,7 @@ def imported(self, session, task):
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):
Expand Down Expand Up @@ -166,7 +166,7 @@ def get_info(self, item, work_info):

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.
Expand Down Expand Up @@ -222,16 +222,17 @@ def find_work(self, item, force):

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",
],
)

0 comments on commit 1790451

Please sign in to comment.