API endpoint for track

I’m working on a project and I currently have only the track ID’s. Is there an existing API endpoint to determine what the recording ID is from the track ID?

I don’t think there is. Maybe there might be some field in advanced query syntax, but I’m not aware of this.

Tracks themselves are not full MB entities that can be queried independently. Hence only storing those is not a good choice.

Only way I see is setting up a DB from the database dumps and making lookups for the track IDs in the database directly.

2 Likes

OK. Unfortunately, (from what I can tell) JellyFin only exposes the track ID to plugins (not the recording ID). I think I might have an idea for a work-around. I’ll post back if it works.

Just to make sure: Have you checked those are actual track IDs, and not recording IDs? Some external software confuses the concepts and names it track ID, even though it is the recording ID.

Partially this is also caused by the file tags being called MUSICBRAINZ_TRACKID for historic reasons).

If Jellyfin is actually only exposing the track ID to plugins I would suggest to file a feature request there to change this.

1 Like

Looking a bit through the Jellyfin source code it looks like it properly reads both recording ID and track ID, and stores them as a provider ID as MetadataProvider.MusicBrainzRecording and MetadataProvider.MusicBrainzTrack. This is stored inside the ProviderIds of an item.

1 Like

Yeah, they’re track ID’s. When I tried a recording lookup with them it failed (and when I took the id and tried musicbrainz.org/recording/id), but it did work fine when I did musicbrainz.org/track/id (but that just redirects to the release page, highlighting the track location). With the interfaces that JellyFin exposes, I couldn’t find anyway to get the recording ID from JellyFin. However my “work-around solution” was to use the release ID that JellyFin provides and make a call to MB and loop through the tracks returned comparing the track ID’s and once I found a match, I return the corresponding record ID. This work-around of-course adds unnecessary computing for each track, so it’s not desirable (even after I added a dictionary to speed the process up). I’ll see what I can do with submitting a JellyFin ticket (I’ve not touched GitHub since M$ betrayed developers on the platform).