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

Add MBID tag to downloaded musics #81

Open
Maxmystere opened this issue Sep 20, 2021 · 7 comments · May be fixed by #82
Open

Add MBID tag to downloaded musics #81

Maxmystere opened this issue Sep 20, 2021 · 7 comments · May be fixed by #82
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@Maxmystere
Copy link

It would be really great if it was possible to add MBID tags as some self host music servers (for example LMS) can use it for Scrobbling to services like Listenbrainz

@miraclx
Copy link
Owner

miraclx commented Sep 21, 2021

Interesting... we could certainly integrate this. Problem is matching the right tracks to the proper MBIDs. Currently, all three services freyr supports, provide ISRC information. And a quick search shows we can make lookups on Musicbrains with ISRC and it returns an MBID-like ID.. I'm just not sure if this is an actual MBID.

For example: Billie Eilish's - all the good girls go to hell
Freyr identifies it's ISRC as USUM71900766

$ curl "https://musicbrainz.org/ws/2/isrc/USUM71900766?inc=releases&fmt=json" | jq

{
  "isrc": "USUM71900766",
  "recordings": [
    {
      "disambiguation": "",
      "title": "all the good girls go to hell",
      "first-release-date": "2019-03-29",
      "length": 168840,
      "id": "1c3683c9-9008-4777-866b-5aacea6187dc", // <-- this the right ID?
      "video": false
    }
  ]
}

@Maxmystere
Copy link
Author

Maxmystere commented Sep 21, 2021

Yup you found a solution in a lot less time than me (I didn't know about that ISRC information)
And seems like that id is exactly what's needed for the track
https://musicbrainz.org/recording/1c3683c9-9008-4777-866b-5aacea6187dc

Seeing the curl response it might be needed to handle multiple recordings as an answer but the first one should be the best one

@miraclx
Copy link
Owner

miraclx commented Sep 21, 2021

I see. Well, that makes sense. Btw, is this something you'd be interested in working on?

@Maxmystere
Copy link
Author

I tried searching on it before adding that ticket but i'm really not enough into JS to handle it well 😄 and as well as you

@miraclx
Copy link
Owner

miraclx commented Sep 21, 2021

Oh, yeah.. Just looked through your repos 🙌🏽. Then again, I don't have that much free time on my hands either. But I'll go ahead and leave this ticket open, perhaps sometime in the future I'd dive in or someone else in the community might take up the initiative.

@miraclx miraclx added enhancement New feature or request good first issue Good for newcomers labels Sep 21, 2021
@Maxmystere
Copy link
Author

Do you have leads on where is the best place to add the curl code and variables so that it can be added to the result file ?

I've been trying to read the code but all those async functions make it really hard to debug... And my lack of knowledge in NodeJS is not helping

@miraclx
Copy link
Owner

miraclx commented Sep 24, 2021

You can begin by introducing an async function that takes an ISRC and returns an optional MBID. then thereafter conditionally embedding the value.

On lookup:

Call and await your new function inside the cli:trackBroker async queue. Once you have your MBID, add it to the meta object like the others here.

freyr-js/cli.js

Line 1038 in 14cd19a

const meta = {trackName, outFileDir, outFilePath, track, service};

On embedding:

There's a section for handling metadata embedding, you can add a line here like with ISRC

freyr-js/cli.js

Lines 842 to 844 in 14cd19a

['Digital Media', 'name=MEDIA', 'domain=com.apple.iTunes'],
[track.isrc, 'name=ISRC', 'domain=com.apple.iTunes'],
[track.artists[0], 'name=ARTISTS', 'domain=com.apple.iTunes'],

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants