Home User Forums SongKong Music Tagger Jaikoz Music Tagger Albunack Music Service

Saturday 15 March 2014

Finding split up tracks from compilation albums revisited

The Problem Revisited

A Mac customer wanted to use Jaikoz to only fix some compilation albums that had been broken up into different folders by another application, so typically each song was the only file within its own folder.
A couple of weeks ago I posted a solution to this but since then I have made a couple of improvements:

  • The original script would only find files if there was one file in total in the folder, so if there was one music file plus an image file it wouldn't be listed, it has now been fixed to only count music files.
  • Folders containing more than one music file may need fixing as well so it  has now been extended to allow you to search for x music files in a folder where x is another parameter

Here is the new script ( but no need to copy it there a version available to download)


shopt -s nullglob

find "${1:-.}" -type d | while read dir; do
        files=( "${dir}"/*.{mp4,mp3,ogg,flac,wma,m4a} )
        (( ${#files[@]} == ${2:-1} )) && echo "${files[*]}"
This checks all the folders under the provided one looking for folders containing only the number of music files requested in the folder and list the songs that Jaikoz can process.

Then if we redirect the output to a file, and we name it as a unicode playlist we can load the list of files straight into Jaikoz

And this solution should work for Linux as well

The Solution

Finding the list of orphaned files

Save this file to your Documents folder 
Open Applications/Terminal,
Within Terminal enter

        chmod 777 Documents/findodd2.sh  

and press <ENTER> then

   ./Documents/findodd2.sh MusicFolder NumberOfFiles > playlist.m3u8

and press again.

where MusicFolder is the full path of the root of your music directory and NumberOfFiles is how many music files the folder must contain.

i.e. I might enter:

        ./Documents/findodd2.sh /Users/paul/Music 2 > playlist.m3u8

to find folders in /Users/paul/Music containing exactly 2 music files
this may take a few minutes depending on how much music you have

Then start Jaikoz and drag playlist.m3u8 onto Jaikoz to load the files

Matching files to releases

Ensure View:Show Column Browser is enabled , and use it or the search so that at any one time you only have the songs from one of the album you want to reconstruct listed.

If you know the release exists in MusicBrainz use Action:Match to Release:Match Songs to Specified MusicBrainz Release and then move onto the next release.

Or if you know the release is in Discogs use Action:Match to Release:Match Songs to Specified Discogs Release and then move onto the next release.

If it doesn't exist in either database  you can still use Jaikoz to manually fix the metadata

Then use Action:File and Folder Correct:Correct Filename from Metadata and  Correct SubFolder from Metadata to rename the files and folders to bring the files back together.

Now check the results and then Save Changes

No comments:

Jthink blog Jthink Facebook page google_plus Jthink YouTube channel Email Paul at Jthink Subscribe to Weekly Newsletter