Hi Paul, compliments on a great program, your great work, attention to follow up etc.
Going nuts here…
Basically due the awesome power your program unleashes and the learning curve of understanding required on the MB schema, then all the various ways you have implemented options and nuances, I’m in a mess. And about 3000 hours into trying to sort my collection. Have tried everything and combinations of all… so decided to start from first principles.
Here’s what I want to do. Can Jaikoz do this? (well it cant precisely, but is there a combo of use cases that will get me to the same end?) If not, do you want to develop this? If not are you happy to provide some kick starts for me to develop it, or open source it, on the basis that it could then front end Jaikoz? Is it even feasible?
#!/usr/local/bin/perl
Script to process a messy music collection - of any size scale and scope.
#-------------------------------
Place Holder for all imports etc
#-------------------------------
#-------------------------------
Main Logic Flow
#-------------------------------
Invocation processing - CLO or present menu
Set up environment - various checks, option processing, print info on command and limitations, env checks etc
Scan search scope - directory walk, establish array of filenames in scope
Check filename extentions, assume extenions are right, check required libraries for files in scope, report issues, allow exit.
Read all file headers (ID3, FLAC, APE, etc) (MP3 only in first version) into large 2D array
#\tAssign Unique ID to each file/record
Report header read issues, alow exit
Process Array - Pass 1 - Identify
\tFor each header check for AMPLIFIND ID
#\tOption: For any missing AMPLIFIND
#\t\tOpen file and fingerprint
#\t\tRequest AMPLIFIND ID via web service
#\t\t\tExit loop on timeout, mark exception
#\t\tUpdate in memory array with new ID
#\t\tUpdate in memory array with new APLIFIND ID FLAG
Connect to local MB Database
Process Array - Pass 2 - mark all possible releases and release groups (and all in between)
#\tFor each record:
#\t\tLook up PUID in MB Recording table - return ALL hits (following perhaps in a single SQL query)
#\t\t\tDereference all hits to Track,
#\t\t\t\tDeref to Tracklist,
#\t\t\t\t\tDeref to Medium,
#\t\t\t\t\t\tDref to Release,
#\t\t\t\t\t\t\tDref to Release Group
#\t\tPopulate sparse array (or some DB strcuture - perhaps extension to local MB schema) with ID and contents based on all possible matches (right through to Rel_Grp)
#\t\t\tMark each ID against each match in the chain
#\t\t\tTree Walking all possibilities and marking accordingly
We now have array/DB populated with all possible variations of match
Get up to this point then see what we have
#\tDump out by release / release group
#\tDump out by folder
Possible ideas:
#\tGet all release / release group data for ones lit up.
#\t1. Perfect Match to Release - Exact # of tracks, only 1 match against each track, no over or under laps (expect would be rare)
#\t2. Multiple fully matched releases lit up - check back to folders if no un macthed files then multiple potential exacts
#\t2a.\tFurther analysis to check which best match (preference for file quality or release type/country etc
#\t… lots more work to do here. Might be best to have prtotype operational first then see what we have.
#\tNeed to take into account preferences too
#\tDealing with duplicates will be key - algorithms to balance off file quality vs preferences to support collectores with multiple releases etc.
Various processing GUI etc part - manual intervention to confirm results, override, deal with exceptions etc.
Write results of analysis back to file headers
#\tUpdate MB unique ID and MB Release ID
Done.
Then open in Jaikoz
#\tUpdate meta from existing MB IDS (now correct)
#\tCorrect folders and files, save. done. happy. life back. reintroduce father to children etc.