Bulk Import A List Of MBIDs Into My Collection

New User here, forgive any stupidity please.

I have many LPs and want to automate the process of populating my first MB collection. Many of my LPs are pre-barcode era, so I’m using album spline catalog number with some success. I’ve downloaded the core DB and written some scripts to extract my MBIDs (gids in the release table) based on the release_label catalog_number. This is working well enough to get many of my MBIDs in a locally stored file. I’m looking for a way (userscript, Picard, ???) to read in my list of MBIDs and automatically add them to my MB collection. Thanks for any and all ideas.

You can easily script that in Picard (see Executable Commands — MusicBrainz Picard v2.13.3 documentation ), but there’s currently no remote command to add them to a collection (but it can be done manually in Picard, using context menu on the album title, Collections, you just need to be logged in MusicBrainz).

You can also use the API: MusicBrainz API - MusicBrainz

3 Likes

Thanks, I have been looking specifically for that API documentation, bookmarked now.

While the majority of my collection is CD based, in the last several years I have acquired several hundred LP’s. About 20 years ago I bought a shareware music library program to catalog my CD collection, I kept using it even after it went unsupported and I even had a XP virtual machine dedicated to its use. About 8 years ago I exported all the information to an excel worksheet that had the barcodes, catalog numbers and other information I had entered in the catalog program. I wrote a couple of Perl scripts to retrieve the release information from MusicBrainz using the barcodes and catalog numbers I had exported. I wrote some bash scripts to extract and merge all that information which got me 50% to my goal. The next step was sifting through all the duplicates to determine which release was correct and assign that releaseID to the album. From there on it was all manual, adding releases to the DB and diskIDs to the DB. The spreadsheet has everything I need to link to the DB release. At some point in time the spreadsheet will move to an actual DB. All CDs are ripped and archived in FLAC album+cue format. MP3’s are generated from the FLAC archive then tagged with the acoustID submitted. There is a lot more information I have collected and stored.

LP’s are cataloged in the same way and if they are not in the DB I add them. I rip the LP’s using a Tascam DAC and Audacity. I do basic click removal and archive as a FLAC+cue. There is a lot of extra processing with the LP’s.

Now that I have all the information I am getting close to creating my MusicBrainz collections since I know there is an API, and it is real easy to use. As a side note, I have cygwin installed on my windows box and do all my scripting and processing using Perl and bash. I use curl for most API use but a quick bash script using wget for one offs is normal.

1 Like

Thank you Zas. A question about the user docs, if you don’t mind: Section 14.1.5 says LOAD can be used to “Load one or more…” I’d like to have all of my (release) MBIDs in a file and have the LOAD command read the file and process all of the (release) MBIDs. Can you show me an example of what the command looks like and what each MBID line in the file looks like? Do I need to have some SLEEPs in there to avoid overloading the server? Thanks again.

I’m using cygwin and bash. I’m old and perl wasn’t around when I learned unix/bash, ha ha. I can see this will be an iterative process but I’m optimistic that I can get a least half of my LPs into a MB collection using my steps to map spline catalog numbers into MBIDs.

Yes, it also looks like the context menu can be applied to a group of selected MBIDs all at once.

Wow, the API is super fast. Exported all the release MBID’s to a list. Read the list in 272 relID increments creating/executing the following line ten times (with a 5 second sleep between PUTs).

curl -u ‘user:pass’ --digest -X PUT https://musicbrainz.org/ws/2/collection/collMBID/releases/relMBID;relMBID?client=my.collection.0.1

1 Like

Late to the party, but here’s a little Go program that I use to keep a collection in sync with my local music database:

It reads a list of MBIDs from a file (or stdin) and adds/removes entities from the collection to make it match.

3 Likes