discogs_importer: subtracks in Discogs to separete tracks in Musicbrainz#281
discogs_importer: subtracks in Discogs to separete tracks in Musicbrainz#281hirokobayashi wants to merge 8 commits into
Conversation
|
Hello @hirokobayashi, |
This commit fixes #138 Please check the discogs document about track and heading here. Original discogs importer uses a heading as a track and subsequent tracks are merged into the heading. |
|
Oh thanks, in fact you already found a doc about the distinction between indeed tracks (that are 1 CD track) and headings (CD track set, logical group of several CD tracks). I would like to test your patch with the two cases and come back here afterwards. |
|
I've run into the bug this fixes. Here's a vote for merge! |
|
Please merge this! |
|
Pinging @jesus2099 @murdos @Schweinepriester @kellnerd I'm happy to rebase this if someone will commit to merging it in the next week. |
|
I've fixed this for classical albums in a really hacked together fork here: https://github.com/kaysond/musicbrainz-userscripts/blob/discogs-classical/discogs_importer.user.js |
|
Oh, is that patch to old now? Sorry @hirokobayashi, only now I took time to test it: I first tested this 2CD release from this post . @kaysond, is that what you meant by rebasing? Next tests will be this single track with indexes release from this other post. |
|
Wow!
(I will update this table with more tests) Wow, it must be so difficult to manage all the cases. |
|
@jesus2099 - correct. This PR is based on a very old discogs import script. Mine was based on the latest one, but its not very good code! |
|
I don't know why and what, but there have been more recent PR merged to this script, since then. And then we ask some admins to merge this quickly, to avoid wasting more time benchmarking later again. |
|
@hirokobayashi could you check out this possible typo: Shouldn't it be |
|
@jesus2099 Thank you for review. I fixed the typo. |
|
I was going to look at it last week, but didn't find the time. Hopefully next weekend, then. I was wondering if you can think about some ways to create automated tests for this, since with so many different ways to write things on Discogs our logic might break any time. Ideally, some way to snapshot all Discogs pages in question and run the script on top of the snapshot. Maybe not to implement it yet, not within this PR, but just to brainstorm how it can be done. |
|
The function "parseDiscogsRelease" in "discogs_importer.user.js" parse a json from Discogs and generate a json for Musicbrainz. I made a script to test it. But I don't know where to put it in this repo. So I'll attach it as a file. # get a Discogs track file as json
curl https://api.discogs.com/releases/1996829 > trackset.json
# generate expected result
node test.js trackset.json > trackset-expected.json
# compare the latest result with expected result
node test.js trackset.json trackset-expected.jsonI expect test.js is in the same directory of discogs_importer.user.js I add a mod to export the "parseDiscogsRelease" function to use from test file. |
Hi
I modified Discogs importer to generate separate tracks for Discogs subtracks instead of merging them to one track in musicbrainz.
The track format will be "trackname: subtrackname" which would match the classical music guideline.