-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add BPSyncPlugin #3389
Add BPSyncPlugin #3389
Conversation
Nice!! This looks great. I do think it would be a good idea to land this self-contained version—and then consider factoring out another base class, if that makes sense, in a second pass. |
@sampsyo, this is ready for a review whenever you're free! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great so far! Here are a few suggestions.
return [self.album_for_id(album_id=a['id']) for a in albums] | ||
results = self._search_api(query_type='album', filters=query_filters) | ||
albums = [self.album_for_id(album_id=r['id']) for r in results] | ||
return [a for a in albums if a is not None] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This bit logic along with this early return were added to exclude "empty" (0-track) albums I encountered such as https://www.deezer.com/us/album/6979394.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome; this looks great! Thanks for all your work on both the new plugin and some refactoring.
This is a proof-of-concept for a
bpsync
plugin, Beatport's equivalent ofmbsync
. It allows users to sync changes to Beatport metadata and "backfill" new fields recently added in #3372.I'm considering abstracting this functionality into a
SyncMetadataSourcePlugin
base class (similar toMetadataSourcePlugin
introduced in #3355) which can also be leveraged for Spotify/Deezer/MusicBrainz, although that requires some larger refactors ofBeatportPlugin
andMBSyncPlugin
, perhaps better suited for a separate PR?@sampsyo, what do you think? Is it worth putting the finishing touches on this Beatport-specific plugin, or investing time in a
SyncMetadataSourcePlugin
to future-proof?This PR also closes #3387 by properly assigning
genre
and renamingmusical_key
toinitial_key
.Note: I had to run
on my database to avoid raising
AttributeError: 'TrackInfo' object has no attribute 'musical_key'
whenautotag.apply_metadata(album_info, mapping)
is called.