Import tree to iTunes and destroy?

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Import tree to iTunes and destroy? Thu Jun 17, 2010 12:52 am • by egauthier
The documentation doesn't say how the the "Run rules on folder contents" action is executed. I had assumed synchronously (wait for return of child before moving on). This would make sense to me, allowing for depth-first search and self-destructive actions. However, I have a ruleset which isn't behaving that way.

I'm having a problem when dropping a folder tree from a Network share onto a local "Add to iTunes" droplet. Network share is served from a Mac using afp (but I'm not using Metadata, so it FSTYPE shouldn't be the issue).

iTunes preferences are set to copy files to Library on import.

After some testing, local files work, but files copied over the network are failing. Could this be the fault of iTunes, which perhaps returns a success to Hazel on import, even though it hasn't actually finished copying files into its library? Perhaps my files aren't big enough to make local version fail?

My ruleset is very simple:
Code: Select all
Rule 1: if Kind Folder
Run rules on folder contents
Move file to Trash

Rule 2: if kind any_file
Import file to iTunes
Growl
Move file to Trash



Has anyone seen this before? Any potential solutions?

Thanks.
-Eric
egauthier
 
Posts: 6
Joined: Wed Jun 16, 2010 11:21 pm

Re: Import tree to iTunes and destroy? Thu Jun 17, 2010 1:03 am • by egauthier
Here is a test, the file structure looks like this:

    Band
      Album
        Track 1.m4a
        Track 2.m4a
        Track 3.m4a
        Track 4.m4a
        Track 5.m4a


Here are the log entries.
2010-06-16 21:57:36.472 hazelfolderwatch[62073] Band: Rule Process all Folders matched.
2010-06-16 21:57:38.159 hazelfolderwatch[62073] [File Event] File moved: Band moved from folder /Users/eric/Music/Add to Itunes to folder /Users/eric/.Trash.
2010-06-16 21:57:38.160 hazelfolderwatch[62073] File Album is busy. Skipping for now.
egauthier
 
Posts: 6
Joined: Wed Jun 16, 2010 11:21 pm

Re: Import tree to iTunes and destroy? Thu Jun 17, 2010 1:45 am • by egauthier
OK. I just added a "sleep 10" before and after the "Import into iTunes" action and it works (well for this size file it worked).

By the way, for those of you asking yourself, "Why not just drag it directly into iTunes, why use Hazel at all?", there is a method to my madness. I will be pre-processing the files (tagging, etc.). I was just trying to start with the simplest form.

So, has anyone else seen this? Is this an iTunes issue, or Hazel?

Thanks.
-Eric
egauthier
 
Posts: 6
Joined: Wed Jun 16, 2010 11:21 pm

Re: Import tree to iTunes and destroy? Thu Jun 17, 2010 1:20 pm • by sjk
egauthier wrote:By the way, for those of you asking yourself, "Why not just drag it directly into iTunes, why use Hazel at all?", there is a method to my madness.

I was wondering if using the Automatically Add to iTunes folder might be helpful to you.
sjk
 
Posts: 332
Joined: Thu Aug 02, 2007 5:43 pm
Location: Eugene

Re: Import tree to iTunes and destroy? Thu Jun 17, 2010 2:04 pm • by egauthier
Thanks for the tip, but what I eventually want to get to is to do some pre-processing on the files using some other tools before importing them into iTunes. Things like beaTunes, MusicIP Mixer or iEatBrainz, lame, mencoder, AtomicParsley, which will do things like tag, generate digital signatures, set a mood colors, transcode, etc. I do this before importing to iTunes as I also sync the iTunes library to a Linux based media server to stream audio and video throughout the house.

For example, one very practical use would be to generate different video formats with HandbrakeCLI. That way I can always drop the highest quality video on the folder, and my workflow would generate the different files with varying quality levels, codecs, etc. for different devices (HD, AppleTV, iPad, etc.) and then import to iTunes.

These are all things I do manually now and would really like to automate with Hazel.

Regards,
-Eric
egauthier
 
Posts: 6
Joined: Wed Jun 16, 2010 11:21 pm

Re: Import tree to iTunes and destroy? Thu Jun 17, 2010 2:48 pm • by Mr_Noodle
It does appear there may be a problem with iTunes telling Hazel it was successful before it actually finishes. Another solution is, if it's working ok for local files, is to copy/move the file to a temporary location on the local drive before importing. Or, yet another option, is to set iTunes to move the file instead of copy.
Mr_Noodle
Site Admin
 
Posts: 11262
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Import tree to iTunes and destroy? Thu Jun 17, 2010 10:26 pm • by egauthier
I'm just thinking regarding the network files is probably a red herring. Because the finder is copying the files to local folder before triggering Hazel right? So, whether I drop the files on the droplet from a local disk, or a network disk, the resultant actions are acted upon on a local disk.

Or am I missing something?

I don't know how to tell iTunes to move instead of copy. I don't see that in the iTunes Advanced preferences. It is either Copy or don't copy (e.g. just create a reference).

Thanks.
-Eric
egauthier
 
Posts: 6
Joined: Wed Jun 16, 2010 11:21 pm

Re: Import tree to iTunes and destroy? Fri Jun 18, 2010 2:53 pm • by Mr_Noodle
By "droplet", you are referring to a folder being monitored by Hazel? Or is this some separate program you are using?

As for iTunes copying or not, if you have "Keep iTunes folder organized" checked and "Copy files to iTunes..." unchecked, it will move the files into the iTunes library and organize them by band/album/track as you have it. That would get rid of the need to throw the files away after importing them.
Mr_Noodle
Site Admin
 
Posts: 11262
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Import tree to iTunes and destroy? Fri Jun 18, 2010 5:06 pm • by egauthier
Yes, by droplet I mean folder that Hazel is monitoring.

I don't want iTunes to keep it organized for a few reasons.

For now, as a workaround, I am just setting the color label for now, and use another Hazel rule to come back and clean it up in a day or so. That should give iTunes enough time to copy the files :) Not clean, but it works.

-Eric
egauthier
 
Posts: 6
Joined: Wed Jun 16, 2010 11:21 pm


Return to Support