-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[WIP] Add SyncMetadataSourcePlugin #3393
Conversation
Awesome; thanks for getting this started! The problem you're seeing with that error is that beets uses some crazy magic to look for subclasses of
Anyway, this is looking cool so far! It makes me wonder whether the |
Thanks for the quick response as always @sampsyo, exactly what I was looking for! Option 1 seems to be working well, although while testing this with Discogs I realized this PR still needs some more work to match the correct release/tracks. I'll try finishing this off later this week or next. And I agree, the sync plugins for Beatport/Discogs/Spotify/Deezer can be moved into their respective metadata plugin modules, since most of the logic is indeed abstracted away. Edit: I think you meant integrate the sync functionality into the main plugin classes themselves, that makes more sense! |
@sampsyo one other question whenever you're free: in the plugins I've recently added, I've been storing album id's and track id's in the Should we instead be adding source-specific fields such as |
That's a good question. #604 actually has a sort of unresolved architectural challenge… the autotagger matching logic relies on In the mean time, however, I think it makes sense to forge ahead with the status quo and leave the IDs there. A good next step would be to also put them in special source-specific ID fields. Then, finally, we can imagine cleaning up the "pollution" problem originally reported in #604. But I think the best strategy is to do all of those in separate steps. |
Ah gotcha, thanks for the context. I do agree that breaking out the source-specific fields is best done in separate steps. But, I think I'm still missing something here. From what I've seen, it looks like all non-MusicBrainz autotagger plugins set the If this holds true, shouldn't the autotagger rely on the combination/tuple of |
Yes, good point! It should probably indeed do that. |
Along those lines, I think it would also be a good idea to have all the non-MusicBrainz metadata plugins also set the I'm not sure if we have a straightforward way to run UPDATEs on users' databases, but if we did, to go even further we could even "backfill" |
We actually recently added that in #3350! I think we can do without backfilling the database—the uniqueness is actually only used to distinguish between match objects, not to align with the database itself. That is, it's possible for the MusicBrainz backend to produce multiple |
Side note, not sure it's really related, but probably good to check on the metasync plugin regardless, just in case. |
@rhlahuja are you still interested in continuing this? |
@jtpavlock I am, but unfortunately don't have the time to commit right now. Are you interested in picking it up? |
I'm not, I was checking in on the status. I'll just mark this as a draft for now, but feel free to keep working on it at your own pace 😁 |
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This code isn't working yet, but gets across the idea of what I'm going after -- simplify the creation of "sync classes" to sync API metadata from plugins that need not be
MetadataSourcePlugin
subclasses, but which must implement:data_source: str
andid_regex: dict
attributestrack_for_id
andalbum_for_id
functionsThis class can then be leveraged to easily create plugins for syncing metadata from Discogs, Spotify, Deezer, and Beatport.
Right now, I'm running into the following stacktrace because
plugins.find_plugins()
is trying to instantiateSyncMetadataSourcePlugin()
on its own, when it's only intended to be instantiated in subclasses with arguments (see subclass implementations). I haven't dug into this much, but suspect there's a better way to implement this, perhaps using metaclasses.I plan to dig into this more later, but wanted to throw it out there in case @sampsyo or others have suggestions of better ways to structure this.