SongKong Jaikoz

SongKong and Jaikoz Music Tagger Community Forum

Ideas for exact release matching

I know the exact release (catalog number) I have for many of my albums.

I have them listed in my Discogs collection (https://www.discogs.com/user/jbsilva/collection) and I also know in what folder they are.

Any of the following features would allow me to update my tags without too much manual labor:

  1. Force Fix Songs to only match if a specific tag matches
    For example, I could use another software to write “Catalognumber” or “UrlDiscogsReleaseSite” and run Fix Songs knowing that it would not match any other release.
    Or the catalog number could be read from the folder name, as I usually already do after tagging.
  2. Add an option in Fix Songs to only search releases in a Discogs collection
    Would work most of the time. I have different versions of the same album, but usually are for bonus tracks or live version.
  3. Command line interface for ‘Match to One Album’
    With an option to accept the if the match is higher than ‘80’ for example. I can easily write a script to run in every folder.

The 3rd option is actually my favorite, as I had some problems with Fix Songs not identifying correctly multi-discs and I don’t need any preprocessing.

Okay we need to explore this a bit more, are you trying to match your songs to a particular Discogs release, or are they already matched to a release and you just want to update them with the latest metadata. It is worth nothing that once they have been matched, on subsequent reruns SongKong will just update with any new metadata added to the release it has already matched to it wont try to rematch.

But understand that SongKong is primarily a MusicBrainz tagger, because MusicBrainz is much better structured then Discogs and only MusicBrainz has direct links to AcoustIds. For example the Classical formatting options that SongKong has currently only apply to MusicBrainz releases not Discogs releases. This is party because MusicBrainz is our primary database but also the classical matching algorithm considers entities like Works that Discogs does not even have.

So assuming the issue is getting the right match lets go back to your potential solutions.

  1. This options is very custom and not going to be useful to anyone else.
  2. So you can limit Fix Songs to only match against Discogs, but we cannot limit by a user collection because we use our own Albunack database not Discogs directly so it does not have collections.
  3. So you could use Fix Songs from command line in this way, but we don’t have the 80% score limit. But the thing is the scoring is useful for deciding the best match, it is not so useful for determining if the best match is good enough. If your songs have no metadata then it is going to be harder to get a high score than if they have good existing metadata even if matching to correct release.

I think we should address the issue another way, when you sent me your support it seems many albums were matched to the right album , at least as right as album with the right track listing by right artist . But say you have the Bulgarian release rather than the French release, and they are identical in evey respect except catalogno going to be hard for SongKong to get that right.

I have one idea, you say you can script so what you could do is process the metadata in file, or from the spreadsheet created by SongKong, and check against the Disocgs Collections list you have to find which are correct and which are not. Then for the ones that are not interactively use Match to One Album and specify the Discogs Release Url to force match to right album.

I suppose if you could run Match One Album from command line without the editing stage and you know the Discogs release you want to match it to then you could set that as parameter and hence you don’t actually need the 80% limit because you know its the right match, this is very similar to your option 1

A CLI for ‘Match to One Album’ with the Discogs/MusicBrainz URL (or the CatNo) as parameter would be perfect!

I was considering the “auto accept if score bigger than X” to avoid any chance wrong track matching or cases where my mapping between release and folder is somehow wrong.

MusicBrainz also has collections. I’ll see how many I can match with my library.

Okay I have raised https://jthink.atlassian.net/browse/SONGKONG-2569 and https://jthink.atlassian.net/browse/SONGKONG-2587

1 Like

BTW Match to One Album does not allow match unless an acceptable mapping can be found and it passes additional checks. In recent release we add an option to disable the additional checks and allow poorer matches but even then unless a basic mapping can be achieved SongKong will not allow a match

1 Like

Now fixed in new 10.5

Great, this feature will be very useful =)

It still cannot query MB direcly, right?
For the release I created last month I get Unable to retrieve album from MusicBrainz:9b7ae61b-7959-4420-9dd4-91c0eb35fb6d.

I started from scratch with Docker.
I first added my license and set my preferences.
Then I ran the following:

$ sudo docker run \
    --network host \
    -v $PWD/config:/songkong \
    -v /volume1/Music/Music:/music \
    songkong/songkong -c -o musicbrainzOrDiscogsId=https://musicbrainz.org/release/90392b89-77fc-3c39-813d-c5c09abf8943 /music/NO_CATNO/MP3/2004\ -\ The\ Human\ Equation\ \(2\ CD\)

debuglogfile is:/songkong/Logs/songkong_debug%u-%g.log
userlogfile is:/songkong/Logs/songkong_user%u-%g.log
SongKong:start
No Profile set so using Profile:Default:/songkong/Prefs/songkong_matchalbum.properties
java.lang.NullPointerException
        at com.jthink.songkong.preferences.UserPreferences.<init>(UserPreferences.java:220)
        at com.jthink.songkong.preferences.UserPreferences.switchProfiles(UserPreferences.java:242)
        at com.jthink.songkong.cmdline.Cmd.setUserPreferencesFromProfile(Cmd.java:85)
        at com.jthink.songkong.cmdline.CmdMatchOneAlbum.start(CmdMatchOneAlbum.java:67)
        at com.jthink.songkong.cmdline.CmdLineDecoder.startCmd(CmdLineDecoder.java:338)
        at com.jthink.songkong.cmdline.CmdLineDecoder.start(CmdLineDecoder.java:259)
        at com.jthink.songkong.cmdline.SongKong.cmdlineOrRemoteModeStart(SongKong.java:1084)
        at com.jthink.songkong.cmdline.SongKong.finish(SongKong.java:1293)
        at com.jthink.songkong.cmdline.SongKong.main(SongKong.java:1321)
null
java.lang.NullPointerException
        at com.jthink.songkong.cmdline.CmdMatchOneAlbum.start(CmdMatchOneAlbum.java:128)
        at com.jthink.songkong.cmdline.CmdLineDecoder.startCmd(CmdLineDecoder.java:338)
        at com.jthink.songkong.cmdline.CmdLineDecoder.start(CmdLineDecoder.java:259)
        at com.jthink.songkong.cmdline.SongKong.cmdlineOrRemoteModeStart(SongKong.java:1084)
        at com.jthink.songkong.cmdline.SongKong.finish(SongKong.java:1293)
        at com.jthink.songkong.cmdline.SongKong.main(SongKong.java:1321)
Options for SongKong are as follows:

I submitted a support file.
Seems to be related to having no preferences set. I thought there were some default ones in the fresh install.

I did some operations in the web interface in preview mode and went back to the CLI.
The same command outputed:

$ sudo docker run \
    --network host \
    -v $PWD/config:/songkong \
    -v /volume1/Music/Music:/music \
    songkong/songkong -c -o musicbrainzOrDiscogsId=https://musicbrainz.org/release/90392b89-77fc-3c39-813d-c5c09abf8943 /music/NO_CATNO/MP3/2004\ -\ The\ Human\ Equation\ \(2\ CD\)

debuglogfile is:/songkong/Logs/songkong_debug%u-%g.log
userlogfile is:/songkong/Logs/songkong_user%u-%g.log
SongKong:start
Using Current Profile:Default:songkong_matchalbum.properties
Override Option musicbrainzOrDiscogsId=https://musicbrainz.org/release/90392b89-77fc-3c39-813d-c5c09abf8943
Start match to one album (preview only)
null
Summary:
Processing:0
Songs loaded:0
Songs saved (if not preview):0
Songs renamed (if not preview):0
Completed:0
Errors and Warnings:0

Why 0 songs loaded? The folder does exist:

$ sudo docker exec -it songkong ls "/music/NO_CATNO/MP3/2004 - The Human Equation (2 CD)"
Covers      Disc 1      Disc 2      folder.jpg

This seems to happen when I have two containers running (one for web, one for CLI).
After shutting down the web container:

$ sudo docker run \
    --network host \
    -v $PWD/config:/songkong \
    -v /volume1/Music/Music:/music \
    songkong/songkong -c -o musicbrainzOrDiscogsId=https://musicbrainz.org/release/90392b89-77fc-3c39-813d-c5c09abf8943 "/music/NO_CATNO/MP3/2004 - The Human Equation (2 CD)"

debuglogfile is:/songkong/Logs/songkong_debug%u-%g.log
userlogfile is:/songkong/Logs/songkong_user%u-%g.log
SongKong:start
Using Current Profile:Default:songkong_matchalbum.properties
Override Option musicbrainzOrDiscogsId=https://musicbrainz.org/release/90392b89-77fc-3c39-813d-c5c09abf8943
Start match to one album (preview only)
Songs loaded 31:Fingerprinted 20: MusicBrainz 31: Discogs 31: Saved 31
Report Creation 100%
Report Created:/songkong/Reports/MatchAlbumReport00002/MatchAlbumReport00002.html
Summary:
Processing:0
Songs loaded:31
Songs saved (if not preview):31
Songs renamed (if not preview):0
Completed:31
Errors and Warnings:

This is a 2 CDs album that Fix Songs got wrong (matched to the 1 CD version. The second disc matched “song only”).
“Match to One Album” solved that :fireworks:

I plan to write a script to run “Match to One Album” multiple times, so:

  1. How to use the CLI from the container I’m already running for the web version?

    This would reduce overhead and I saw that the command fails when I try to run both at the same time.
    Maybe something in /opt/songkong/songkong.sh?

  2. Does it have different exit codes? Can I generate a less verbose and parseable output?

  3. Could I paralellize it (any rate limits?)? Any other tip?

When using web/desktop ui on first run if there are no profiles in your /songkong folder then they are copied over from installation directory, but this doesnt happen if using command line. So I think this is the issue you are seeing here. So the workaround would be to be start docker once in remote mode with /songkong configured to real folder that will then have the profiles copied to it, then subsequent new containers using same folder will pick up the profiles. Need same approach for license as well.

We dont do direct Musicbrainz lookup if not in albunack database yet, that is a different issue

So in your first few examples you specify folder name as

/music/NO_CATNO/MP3/2004\ -\ The\ Human\ Equation\ \(2\ CD\)

but in the working version you specify as

"/music/NO_CATNO/MP3/2004 - The Human Equation (2 CD)"

So I think that issue is when you tried to do it with escapes you did it wrong, just surround in double quotes.

But also you mention running two version and parrallelization, you should not run two instances of SongKong at the same time and we have an issue raised to prevent this. If we think about a more usual non docker install attempts to run two instances at the same time mean they will both be trying to access the same internal database this will not work. Also SongKong is already optimized for parallelization processing multiple folders at the same time adjusting throughput with consideration for number of cpus, disk access and also rate limits for online lookups.

So for the best performance and quickest results run Fix Songs on your collection.But you want to run Match One Album on a list of folders and this needs to be done one folder at a time in serial. Now if you try to work round this by having multiple containers with their own config folders (hence own database) you are not going to gain anything because they cannot cache downloaded results into database, still subject to global rate limits imposed by server so some queries will fail, and it will be much more difficult to write your automated script to handle issues and results if dealing with multiple instances.

Address specific questions at end

You cannot access the same container instance via the web and the cmd line at same time, either run it in Web mode or command line mode. So best approach would be have one standard container that runs in remote mode, then for each folder can create a new container (as you have done with run command) that runs Match to One Album for that folder. Have all containers share the same /songkong folder but ensure you don’t run the command line containers when the the web container is running, and only one command line container at a time.

No, please understand cmd line is a niche part of SongKong never used by most users so I dont want to spend alot of time adjusting it and it is best if the output doesn’t change much so it doesn’t break any existing scripts.

No, please dont do that.

About the " vs \: both work when it’s only one container running.

I’ll do all in sequence. It’s easier and makes sense.

The only question left is how to avoid starting a new container for each run.
Something like doing a docker run and multiple docker exec.

Sorry I dont know if that is possible im not a docker expert

I think this worked:

entrypoint: /bin/sh (or empty maybe?)
command: -c "tail -f /dev/null (or whatever dumb command)

And then

$ sudo docker exec -it songkong sh -c '/opt/songkong/songkong.sh -c -o musicbrainzOrDiscogsId=https://musicbrainz.org/release/90392b89-77fc-3c39-813d-c5c09abf8943 /music/NO_CATNO/MP3/2004\ -\ The\ Human\ Equation\ \(2\ CD\)'

Songkong still takes ~9s initializing, but I think I can live with that.

Thanks again, Paul!