feat(plex): Retrieve MusicBrainz IDs#426
Conversation
✅ Deploy Preview for multi-scrobbler canceled.
|
|
Thanks for the PR! Is there a reason you couldn't use |
|
I originally tried to use the The same goes for There's also been major changes to the |
|
That's fair. I wish the library was better and had those relaxed methods, like you mentioned. It's been a pain point for me. Maybe the newer version will work better. I'll try it with the new version and if it's not easy i'll go with your PR as-is. Thanks for doing the legwork 👍 |
|
Hopefully you'll be able to get it to work! I tried pretty much the exact example from the library docs for the new version (0.43.0) and it just seems to be completely mismatched with the actual Plex API. The MBIDs are in the response but it seems like it's expecting them to be numbers. index.ts: import { PlexAPI } from "@lukehagar/plexjs";
const plexApi = new PlexAPI({
token: "...",
serverURL: "...",
})
async function run() {
const result = await plexApi.content.getMetadataItem({
ids: ["16900"],
})
console.log(result);
}
run();Error: |
* Use Keyv memory cache * Return undefined instead of null to simplify assignment * Throw error with cause for clearer logging
📦 A new release has been made for this pull request.To play around with this PR, pull an image:
Images are available for x86_64 and ARM64.
|
|
@owendaprile I'm going to use your implementation after all. It's simpler than trying to make plexjs cooperate 😒 I've updated the branch with some commits:
If everything looks good to you (can try testing the published docker image |
|
Seems to be working the same. I'm scrobbling to teal.fm so without #425 I don't see artist MBIDs, but both release and recording MBIDs are coming through: https://pdsls.dev/at://did:plc:zhxv5pxpmojhnvaqy4mwailv/fm.teal.alpha.feed.play/3mbp2vwukcv2k |
Checklist before requesting a review
Type of change
Describe your changes
This adds support for retrieving MusicBrainz IDs for tracks, albums, and album artists in the Plex source for libraries that use the Plex Music agent and where the albums have been matched to a MusicBrainz result (in Plex).
Plex does not seem to store MusicBrainz IDs for track artists, so this uses the album artist for both album artists and track artists. This way, sources that don't support album artists still get an artist MBID.
I'm running this with no issues through teal.fm: https://pdsls.dev/at://did:plc:zhxv5pxpmojhnvaqy4mwailv/fm.teal.alpha.feed.play/3maos62xhyb2y