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

Re-imports don't update data_source flex attr #4726

Closed
JOJ0 opened this issue Mar 22, 2023 · 2 comments · Fixed by #4735
Closed

Re-imports don't update data_source flex attr #4726

JOJ0 opened this issue Mar 22, 2023 · 2 comments · Fixed by #4735
Labels
bug bugs that are confirmed and actionable

Comments

@JOJ0
Copy link
Member

JOJ0 commented Mar 22, 2023

Problem

When importing an album or a singleton that was previously imported already, the data_source flexible attribute is not updated. It stays as initially imported.

Setup

  • OS: ---
  • Python version: ---
  • beets version: 1.6.1 dev-latest
  • Turning off plugins made problem go away (yes/no): no

Proposed solution

data_source needs to be excluded in reimport_metadata()

@JOJ0 JOJ0 added the bug bugs that are confirmed and actionable label Mar 22, 2023
@arsaboo
Copy link
Contributor

arsaboo commented Mar 25, 2023

Even album re-import does not update data_source.

@JOJ0
Copy link
Member Author

JOJ0 commented Mar 26, 2023

Thanks for testing and clarifying. I was actually assuming that this is also the case but I wasn't sure yet. So, many thanks, that is very helpful! :-)

I'm pretty sure the problem is located here:

beets/beets/importer.py

Lines 810 to 812 in 4194914

def reimport_metadata(self, lib):
"""For reimports, preserves metadata for reimported items and
albums.

On a reimport this function looks up what data_source is in the library already and then simply re-applies it. Similar to the ID fields over at PR #4708, data_source would need to be excluded from this "preserving mechanism".

We should investigate older issues and the one that implemented the reimport_metadata() method and make sure this is not "intentional" behaviour. If it was, I could think about making it configurable. As I see it now though, it feels like a bug, data_source is an informational field and after a reimport it is just wrong. I do use this field sometimes to save that "I tagged this manuall" with beet mod data_source=MANUAL query, but also then if I do find an appropriate album in some metadata source, it makes sense that this field gets overwritten and tells the truth.

@JOJ0 JOJ0 changed the title Singleton re-import doesn't update data_source Re-imports don't update data_source flex attr Mar 26, 2023
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.

2 participants