SongKong Jaikoz

SongKong and Jaikoz Music Tagger Community Forum

Bug SongKong folder creation

As I mentioned in the other thread I have been losing my files due to songkong and after testing I have identified a couple of reasons why.

  1. SongKong duplicates some folders and files. As you can see from my screenshot above there is 2 folders labeled (red circled and yellow circled. I will get to the orange one shortly)
  • [theater] why is there 2 folder with this label?
  • [unknown] why is there 2 folders with this label?
  • Ace of Base (there is only 1 band with this label so why 2 folders?)

and there is many more like this. Windows does not like duplicate folder / files names. Most of the time windows will not allow me to open 1 of the folders let alone play something from it.

Sub
There are the options I have set:

  • Rename mask: Artist/Title
  • Compilation rename mask: Artist/Title

This one is unfortunate but apparently songkong can be forced to run/execute function/commands if they are included in the Artist/Title fields. As you can see with the options, I have selected above songkong SHOULD NOT create a single subfolder. And yet

As an example in my song library I have a group called G//Z/R and guess what songkong did with this groups name?

Created Parent folder labeled G, Subfolder Z, and another subfolder R. then it placed the songs into folder R

I wonder what other function would I be able to run if I put into the Artist or Title and the app would execute it?

Now to the yellow circled folder from my screen shot. I have 268 AC/DC songs and songkong put 53 into the AC-DC folder and for the rest the app created a Parent folder AC with Subfolder DC and put 215 songs into the DC folder.

I will look into this in more detail later but when I looked at the support files you sent me they were run using SongKong in a Linux based docker, but here you seem to be using on Windows.

Linux file paths are case sensitive, Windows is not. So if you run using docker depending on metadata and mask you could have multiple folders with same name except case, this would not happen if only ran on Windows. If you then try to access these files via Windows it will have an issue.

If metadata in fields used for mask contains / it should be handled by automatically converting to - so AC/DC should become AC-DC and G//Z//R should become G–Z-R so not sure what happened here. SongKong is not allowing you execute functions as you put it, it simply does not seem to be handling / in metadata correctly.

Can you send support files please.

More thoughts about Ace of Base, for example it may be your original metadata for the artist was Ace Of Base (capital O), SongKong has identified most albums and corrected the metadata to Ace of Base (lowercase o) but some albums have not been corrected and therefore remain Ace Of Base (capital O). Because you then ran rename files on all files two different folders will exist depending on the value of artist field.

I checked the code and it does replace occurences of / in the metadata with - for all platforms so not clear why you have this issue.

/**
     * Clean the value for use in filename
     *
     * To solve the AC/DC problem, this makes changes to any values whereby it should not appear anywhere in the filename
     *
     * On OSX '/' means a folder separator, on Windows it doesn't but it is still an invalid value in a filename
     * so we replace with the '-' in all cases
     *
     * On Windows '\' means a folder separator, and on OSX and Linux it is used to escape chars so replace with '-'
     * in all cases.
     *
     * SONGKONG-620:
     * 1. Remove leading and trailing spaces
     * 2. Remove occurrences of double spaces, and replace them with single spaces
     * 3. Protect against artist being too long and filling up the filename part and then if its get shortened
     * later because > 255 we end up with duplicate artist names
     *
     * @param value
     * @return
     */
    private String cleanValue(SongFieldKey key, String value)
    {
        if(key==SongFieldKey.ORIGINAL_FILENAME)
        {
            value = value.replace('\\','/')
                    .trim();
        }
        else
        {
            value = value.replace('/', '-')
                    .replace('\\', '-')
                    .replace("  ", " ")
                    .trim();
        }
        return value;
}

But in the support files you sent me for other issue there is only an AC-DC folder, there is no AC folder maybe this was done by a different application.

image

SongKong is run in docker in Unraid. That folder “/music” is mapped as a shared drive in Unraid and that folder is used as network drive on windows machines

As mentioned in the other thread that I had sent in support files for was based on over 6k files getting tested by me as it is easier for me to review and get an idea what is going on. This run above was for over 90k files

Originally wasn’t planning on submitting the support files at this time as I was trying to understand / figure out some other issue’s

Like:

  1. Why is it if I select Yes if matched to a release or song it usually takes about 1 hour 45 mins
    but if I select Yes if has Metadata it takes nearly 5 hours to run on nearly the same number of songs. I can only assume its because of the errors song is complaining about. (“Yes if matched” generated 2 errors but “Yes if Metadata generated over 70 errors”)

  2. Why is it when I ran rename with Yes if matched to a release almost 700 songs weren’t touched/moved. But there doesn’t seem to be a report / error explaining/showing why or what could be wrong with those files. For example (really wish this view listed total count of files that are listed)

This page only had about 120 to 150 files that were shown as not updated. So where is the rest? should be about another 450

  1. As mentioned above if I select Yes metadata the error that were generated (few examples):

Cannot invoke “com.jthink.songlayer.CoverImage.getDataKey()” because “coverImage” is null
commit failed <- what does that mean
could not prepare statement <- what does that mean
null id in com.jthink.songlayer.SongProcessed entry (don’t flush the Session after an exception occurs)

Because Yes if matched to a release means the album has been matched by SongKong to a MusicBrainz or Discogs release, but Yes if metadata just meand the files have some metadata but have not necessarily been matched to an album by SongKong, they probably just have their original metadata. So Yes if matched to a release is going to be renaming less songs than Yes if metadata and hence take longer to run.

Probably because not matched to a release, just use Browse by Folder again and filter by Updated Filter Not Updated and Match to Album:Without Full Album Match will probably show the files that have not been renamed.

As mentioned above if I select Yes metadata the error that were generated (few examples):

Not sure it s going to be much easier for me to help if you send the support files so I can see them and the logs in their entirety.

Oh I see you have uploaded them, thanks, bit late here so I will look tomorrow.

Okay one thing I have noticed is you have enabled Move Folder and Move Unmatched Folder but the folder is set to same as the starting folder /music so actually there is no move. I wonder if this is possibly confusing SongKong so please uncheck both Move Folder and Move Unmatched Folder then rerun Rename Files so see if that resolves anything.

Rename Files

  • Move Folder:
  • Move Folder: /music
  • Move Unmatched Folder:
  • Move Unmatched Folder: /music

Okay I can see bug here raised https://jthink.atlassian.net/browse/SONGKONG-2698

and these errors occur because of the error

commit failed

could not prepare statement

so they all comprise one error that wil be fixed by fixing issue.

Bit stumped about the AC-DC issue, my only possible solution at moment is disabling the Move Folder options discussed above, once I see the results of this I can proceed further.

Thanks for the file but I cant replicate the issue, I dont think the problem is file specific I think its more to do with interactions during rename so i will wait for the Rename without Move options set.

Okay thanks for the support files.

The Ace Of Base issue disappeared but it seems with RenameFiles00013 you dont seem to have just rerun against the existing /music folder instead it looks like you deleted the contents of /music and ran against a new copy moving it into music, and the Ace of Base issue disappeared after this.

I have made some progress with AC/DC as I could not understand why some were moved correctly and some were not.

I selected Browse By Artist/Album this groups by the metadata not the folder and instead of just one AC/DC grouping there are two

because the seocnd grouping is not using the usual / (0x002F) character but a different / (0x2044) called a fraction slash.

So my code that converts / to - in metadata doesnt apply to the files with the Fraction slash but somewhere along the line the fraction slash gets converted to a usual slash and hence you get multiple folders.

So the solution is to also convert Fraction Slash to - I have raised an issue https://jthink.atlassian.net/browse/SONGKONG-2702 that Im going to fix now and then release a new version of SongKong later today.

I couldn’t replicate it because I tested on Windows and on Windows it create a folder ACDC which is still wrong (should be AC-DC) but less wrong so the FractionSlash handling must be a unix specific thing.

ACDC issue and some other rename files error issues fixed in 11.3

Let go over the good news:

My G//Z/R
Old: used to be G parent -> Z sub folder -> R sub folder and all songs were placed here
now: All songs were placed into GZR folder

So that part is ‘fixed’

Broken:
" So my code that converts / to - …"

Old: AC-DC folder with over 200 files and a Parent AC -> subfolder DC and about 50 files here
Now AC-DC folder is missing. All AC/DC songs are located in Parent AC -> subfolder DC with 256 files

Apparently your ‘converter’ no longer works so I can only assume it didn’t know where to put them so it put all files into the subfolder

Hm I literally added one line

 .replace('\u2044', '-')

I cannot understand how this would cause problems for metadata with regular slash, can you do Browse By Artist/Album like I did and post screenshot so we can see how the metadata is split.

Also the report page is wrong.

Somehow it completed 57532 files but only loaded 46696 files???

OK I think you are going to have run Create Support Files again, cant make sense of it.

Ah, okay I think i know the issue, your rename mask has changed to use artists_index[0] right, I don’t think the clean up code that convert to ‘-’ is being called when using the index syntax, I’ll look into it now.

Working on it now https://jthink.atlassian.net/browse/SONGKONG-2704