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

Parentwork plugin copious output during import #4120

Open
aereaux opened this issue Oct 23, 2021 · 6 comments · May be fixed by #5135
Open

Parentwork plugin copious output during import #4120

aereaux opened this issue Oct 23, 2021 · 6 comments · May be fixed by #5135
Labels
bug bugs that are confirmed and actionable

Comments

@aereaux
Copy link
Contributor

aereaux commented Oct 23, 2021

When the parentwork plugin is enabled during import, it outputs its changes all over the rest of the import UI, like so:

/home/aidane/music/import/album/The Devil Makes Three - Do Wrong Right (12 items)
Tagging:
    The Devil Makes Three - Do Wrong Right
URL:
    https://musicbrainz.org/release/a4200d5c-9f4a-48e9-abca-3f17f2ee05bb
(Similarity: 100.0%) (CD, 2009, US, Milan, M2-36426)
[A]pply, More candidates, Skip, Use as-is, as Tracks, Group albums,
Enter search, enter Id, aBort, plaY? a
Ralph Vaughan Williams - Flos Campi / Suite for Viola and Orchestra - Flos Campi
  work_date: 1925
  parentwork_workid_current: 409c16ca-3f24-345e-8699-670ad8487171
  parentwork_date: 1925
  parentwork: Flos campi
  parent_composer: Ralph Vaughan Williams
  parent_composer_sort: Vaughan Williams, Ralph
  mb_parentworkid: 409c16ca-3f24-345e-8699-670ad8487171
Ralph Vaughan Williams - Flos Campi / Suite for Viola and Orchestra - Suite for Viola and Orchestra: Group 1: Prelude
  work_date: 1934
  parentwork_workid_current: ecab0d62-041a-42be-921b-ae9c2ae18ccb
  parentwork_date: 1934
  parentwork: Suite for Viola and Orchestra
  parent_composer: Ralph Vaughan Williams
  parent_composer_sort: Vaughan Williams, Ralph
  mb_parentworkid: a28be6ee-076c-4d1c-af1d-d92901e37dc7
Ralph Vaughan Williams - Flos Campi / Suite for Viola and Orchestra - Suite for Viola and Orchestra: Group 1: Carol
  work_date: 1934
  parentwork_workid_current: 921a7f9c-b3eb-4853-8f9b-3a927868b5c9
  parentwork_date: 1934
  parentwork: Suite for Viola and Orchestra
  parent_composer: Ralph Vaughan Williams
  parent_composer_sort: Vaughan Williams, Ralph
  mb_parentworkid: a28be6ee-076c-4d1c-af1d-d92901e37dc7
Ralph Vaughan Williams - Flos Campi / Suite for Viola and Orchestra - Suite for Viola and Orchestra: Group 1: Christmas Dance
  work_date: 1934
  parentwork_workid_current: b6cfe63a-ef42-4a17-b1a9-ea1a9c3d4871
  parentwork_date: 1934
  parentwork: Suite for Viola and Orchestra
  parent_composer: Ralph Vaughan Williams
  parent_composer_sort: Vaughan Williams, Ralph
  mb_parentworkid: a28be6ee-076c-4d1c-af1d-d92901e37dc7
Ralph Vaughan Williams - Flos Campi / Suite for Viola and Orchestra - Suite for Viola and Orchestra: Group 2: Ballad
  work_date: 1934
  parentwork_workid_current: 74cfd0bd-ea2b-42cf-b3a4-64bca63f67a9
  parentwork_date: 1934
  parentwork: Suite for Viola and Orchestra
  parent_composer: Ralph Vaughan Williams
  parent_composer_sort: Vaughan Williams, Ralph
  mb_parentworkid: a28be6ee-076c-4d1c-af1d-d92901e37dc7
Ralph Vaughan Williams - Flos Campi / Suite for Viola and Orchestra - Suite for Viola and Orchestra: Group 2: Moto Perpetuo
  work_date: 1934
  parentwork_workid_current: 217d6d6e-3863-42bc-8cf7-c0db8a210f52
  parentwork_date: 1934
  parentwork: Suite for Viola and Orchestra
  parent_composer: Ralph Vaughan Williams
  parent_composer_sort: Vaughan Williams, Ralph
  mb_parentworkid: a28be6ee-076c-4d1c-af1d-d92901e37dc7
Ralph Vaughan Williams - Flos Campi / Suite for Viola and Orchestra - Suite for Viola and Orchestra: Group 3: Musette
  work_date: 1934
  parentwork_workid_current: 5a8978fc-0769-46fb-9d56-e407b2bfa8ea
  parentwork_date: 1934
  parentwork: Suite for Viola and Orchestra
  parent_composer: Ralph Vaughan Williams
  parent_composer_sort: Vaughan Williams, Ralph
  mb_parentworkid: a28be6ee-076c-4d1c-af1d-d92901e37dc7
Ralph Vaughan Williams - Flos Campi / Suite for Viola and Orchestra - Suite for Viola and Orchestra: Group 3: Polka
  work_date: 1934
  parentwork_workid_current: 19e84f59-c137-405c-a9fa-642c7ba8c75e
  parentwork_date: 1934
  parentwork: Suite for Viola and Orchestra
  parent_composer: Ralph Vaughan Williams
  parent_composer_sort: Vaughan Williams, Ralph
  mb_parentworkid: a28be6ee-076c-4d1c-af1d-d92901e37dc7
Ralph Vaughan Williams - Flos Campi / Suite for Viola and Orchestra - Suite for Viola and Orchestra: Group 3: Galop
  work_date: 1934
  parentwork_workid_current: 37fdda8d-aff8-48e8-ba31-2641e7714ca2
  parentwork_date: 1934
  parentwork: Suite for Viola and Orchestra
  parent_composer: Ralph Vaughan Williams
  parent_composer_sort: Vaughan Williams, Ralph
  mb_parentworkid: a28be6ee-076c-4d1c-af1d-d92901e37dc7
The Devil Makes Three - Do Wrong Right - Statesboro Blues
  parentwork_workid_current: 668b983a-fa68-3306-a1d1-0a3967955e62
  parentwork: Statesboro Blues
  parent_composer: Blind Willie McTell
  parent_composer_sort: McTell, Blind Willie
  mb_parentworkid: 668b983a-fa68-3306-a1d1-0a3967955e62
The Devil Makes Three - Do Wrong Right - Cheap Reward
  parentwork: Cheap Reward
  parentwork_workid_current: 75bc2dfa-16b6-4aae-b918-4811fa20f36d
  mb_parentworkid: 75bc2dfa-16b6-4aae-b918-4811fa20f36d

This makes it hard to know what to input if I take too long and the parentwork outputs a lot of text. This should probably be silenced during import (when there is nothing that it's changing from anyways.

The output (I'm fairly sure) is from ui.show_model_changes, but I'm not sure if that should be changed to not output during import or for parentwork to not call it during an import.

@sampsyo sampsyo added the bug bugs that are confirmed and actionable label Oct 23, 2021
@sampsyo
Copy link
Member

sampsyo commented Oct 23, 2021

Good point! This is coming from here:

return ui.show_model_changes(

@dosoe, perhaps this was left in from some debugging? The plugin should not output anything when the importer is running in non-verbose mode. Could you please take a look?

@aereaux
Copy link
Contributor Author

aereaux commented Oct 23, 2021

FWIW, this seems to match the behavior of mbsync, at least when running after import.

@dosoe
Copy link
Contributor

dosoe commented Oct 26, 2021

Yes, I wanted to match the behaviour of mbsync, but I don't want it to run on import. I will check the other plugins on how they display changes only when they specifically are called and not via an event.

@danni-storm
Copy link

This is still an issue, making the Parentwork plugin almost useless as it prints right over the base beets package output. Would the change not be as simple as just modifying

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'])
to additionally check for verbose mode defined in the completion_script(commands) function:

beets/beets/ui/commands.py

Lines 1813 to 1817 in b116eb5

options['_global'] = {
'flags': ['-v', '--verbose'],
'opts':
'-l --library -c --config -d --directory -h --help'.split(' ')
}
I am somewhat familiar with Python but only on smaller projects without so many moving parts so forgive me if I am incorrect.

@danni-storm
Copy link

For now, until I have more time to dig into the code, I simply removed lines 207:211 in my local plugin file.

@aereaux
Copy link
Contributor Author

aereaux commented Mar 4, 2024

I wrote up a quick change to only output verbose details when running explicitly. Let me know if there's anything I should change with that.

aereaux added a commit to aereaux/beets that referenced this issue Mar 8, 2024
aereaux added a commit to aereaux/beets that referenced this issue Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs that are confirmed and actionable
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants