Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only output verbose details for parentwork plugin when running explicitly #5135

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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",
],
)
Loading