Welcome Guest

Pages: 1
Yate musicdb->itunes
LappenPostJune 27, 2016, 09:22
Beginner
Posts: 33
Registered:
November 8, 2014, 11:13
Normal topicYate musicdb->itunes

Hi,
I have all my files in a Yate DB and was wondering how to add these files in an easy way to iTunes?

I've created an action which i'm running in batch processing mode to add the files to iTunes, but its very slow and does not make use of the database. Therefore i'm hoping that there is an easy way around this when using the DB?

Tia/Lappen

2MR2PostJune 27, 2016, 11:03
Avatar photo
Administrator
Posts: 2085
Registered:
August 23, 2012, 19:27
Normal topicRe: Yate musicdb->itunes

The Add to iTunes functionality currently works only with loaded tracks. However, the ability to add a track specified at runtime is trivial to add. This would allow you to walk your database as opposed to your file structure. I'm assuming you have some indication in the DB as to whether the track is already in iTunes. Adding a track which is already in iTunes can be prone to duplicates.

That being said, I'm not sure you would run that much faster. All my tracks are on a NAS drive and the load time is negligible compared to the time that iTunes takes to actually add the track. My iTunes test library has about 45k tracks and adding a new album can take ten minutes. Sometimes it takes ten seconds. After all these years, I still have no concrete idea as to what they are doing.

If your DB has a flag indicating whether the track is already in iTunes, we can do it now with a net saving as not all files will have to be added and therefore not all files will have to be loaded. If all tracks are being added there will be no saving. If not all tracks have to be added, the action to do so is pretty easy. It involves opening your DB as a Query Database. For each line check if the file has to be added. If it does, do a Load and Run on the file path calling an action which does the add. If you need any help with this, just export the Export set used to define the DB and send it to me at support@2manyrobots.com. If not obvious, describe the column used to detect the need to add the track.

If all tracks have to be added I will look into adding the Add to iTune by path functionality. It'll have to wait until after the next release comes out as it's really close.

2MR2PostJune 27, 2016, 11:29
Avatar photo
Administrator
Posts: 2085
Registered:
August 23, 2012, 19:27
Normal topicRe: Yate musicdb->itunes

Here's a mockup of the code to access your DB as a Query Database. You can hard-code the path and obviously my column names are incorrect, but it should give you the general idea. I've written it to run in the UI but if iTunes is causing you to beach-ball too often, you can drop the code into a Batch Start inline action and follow the Repeat Forever with a Cancel. Then start the Batch Processor and choose any folder to drag over.

Note the following code will not appear correct in an emailed notification as backslash characters are eaten by the mailer.

Constrain Execution to a Single File
Prompt for File with "Choose a DB". Save path to Variable 1 file types 'csv'
Open Database for Querying "\v1" (Keyless) named variables -> db
Set named variable 'Index' to "-1"
Repeat Forever Process One DB Line

Start Process One DB Line
Increment named variable 'Index'
Test if the numeric value of named variable 'Index' >= named variable 'db-Row Count' (Set result)
if true
Exit Repeat
endif
Access Query Database "db", save cell at column 'Flag' to named variable 'Flag', Key="#\<Index>"
Test if the numeric value of named variable 'Flag' == 0 (Set result)
if false
Access Query Database "db", save cell at column 'File Path' to named variable 'Path', Key="#\<Index>"
Load "\<Path>" and run inline action 'Add One Track'
endif

Start Add One Track
Add to iTunes

LappenPostJune 28, 2016, 15:15
Beginner
Posts: 33
Registered:
November 8, 2014, 11:13
Normal topicRe: Yate musicdb->itunes

Thank you....running it right now, and it's working great. Guess i'll have to accept the speed of iTunes :-/

2MR2PostJune 28, 2016, 15:43
Avatar photo
Administrator
Posts: 2085
Registered:
August 23, 2012, 19:27
Normal topicRe: Yate musicdb->itunes

....as do we all 🙁

Pages: 1
Mingle Forum by Cartpauj | Version: 1.1.0beta | Page loaded in: 0.016 seconds.