Page 1 of 1

Hazel moving unrar'ing file before done

PostPosted: Thu Mar 19, 2015 2:15 pm
by staze
All,

There must be a simple fix for this, but I've got a rule that is uncompressing torrented files (which come in rar format) when they're done, and that triggers once Transmission moves them into a folder. The problem is, unrarX doesn't use a temp file name, so it just calls it "filename.mp4" for example. Hazel is seeing this, and moving the file before the unrar is done, which obviously results in an incomplete file.

What do people suggest for fixing this? I swear this used to work just fine, but now Hazel is too on top of it's game. =)

Re: Hazel moving unrar'ing file before done

PostPosted: Fri Mar 20, 2015 12:52 pm
by Mr_Noodle
Is there a reason you aren't using Hazel's Unarchive action? Otherwise, you can add a condition like "Date added is not in the last X minutes" to introduce a delay before the rule is run.

Re: Hazel moving unrar'ing file before done

PostPosted: Fri Mar 20, 2015 12:55 pm
by staze
Hmm... I didn't think it worked with multipart rars... it failed after the first one, but I'll check again.

Re: Hazel moving unrar'ing file before done

PostPosted: Fri Mar 20, 2015 1:13 pm
by staze
seemed to work. okay, will just use that instead. Cleaner that way, anyway (don't have to applescript getting unrarx to quit). =)

Re: Hazel moving unrar'ing file before done

PostPosted: Wed Mar 25, 2015 2:17 am
by staze
just realized why I wasn't using it... it removes the rars after unraring.

Is there a way to have it not do this, or an easy rule that can copy the whole shebang, and unrar? otherwise it screws with the torrent seeding (since I'm removing all the downloaded files)...

Thanks!

Re: Hazel moving unrar'ing file before done

PostPosted: Wed Mar 25, 2015 11:17 am
by Mr_Noodle
You can do a copy first then unarchive that.

Re: Hazel moving unrar'ing file before done

PostPosted: Wed Mar 25, 2015 11:30 am
by staze
Yup, realize that. I just need to figure out a rule for that. :/

Re: Hazel moving unrar'ing file before done

PostPosted: Thu Mar 26, 2015 1:43 pm
by staze
staze wrote:Yup, realize that. I just need to figure out a rule for that. :/


okay, I'm at a loss on this one. How do I check to see if a folder has a rar file in it, if it does, copy it to another location to unrar... and if it doesn't have a rar, leave it in place. Or am I overthinking this?

Re: Hazel moving unrar'ing file before done

PostPosted: Fri Mar 27, 2015 2:17 am
by bigjohn
.

Re: Hazel moving unrar'ing file before done

PostPosted: Fri Mar 27, 2015 11:37 am
by Mr_Noodle
staze: Do you want to copy the folder or the rar file? If the folder, then hold down option while clicking the + button to create a new condition. That will create a nested condition. There you will see a pop-up to specify the target of the conditions underneath it. There you can set it to apply conditions to the subfiles in the folder.

bigjohn: Please post a separate topic. Your question has nothing to do with this thread.

Re: Hazel moving unrar'ing file before done

PostPosted: Fri Mar 27, 2015 12:35 pm
by staze
Mr_Noodle,

I think I figured out a way to do it, but I'm not 100% that there won't be some weird "race" condition.

I moved my unraring and sorting rules to another folder, then have a rule that runs on my "Downloaded" stuff (which Transmission moved to the folder after it's done), that just copies anything that's *.r* to my unraring folder (after marking the source folder "green" as having been dealt with. That means .r00, .r01, etc. Since .rar is last in that alphabet, the unraring task doesn't start until after they're all copied over.

My concern would be, what if they're labeled .rar, .rar01, .rar02, etc. Then the .rar would be copied first, and the unrar process would fail, fail, fail.

Any thoughts on how I might resolve a situation like that? I guess I could copy them all over, then once that's done, tag the .rar file for processing, and just look for that.

Re: Hazel moving unrar'ing file before done

PostPosted: Fri Mar 27, 2015 5:12 pm
by Mr_Noodle
Is "rar01" common? I don't recall seeing that myself. Otherwise, it's a bit tricky to determine when it's done. You'd probably need to write a script to be able to determine that and report that back to Hazel.

Re: Hazel moving unrar'ing file before done

PostPosted: Fri Mar 27, 2015 5:19 pm
by staze
Mr_Noodle wrote:Is "rar01" common? I don't recall seeing that myself. Otherwise, it's a bit tricky to determine when it's done. You'd probably need to write a script to be able to determine that and report that back to Hazel.


no, not common, but I have seen it. Right now, it's working... so we'll call it good. Any chance you'll add an option to "Unarchive" to leave original files in place?

Re: Hazel moving unrar'ing file before done

PostPosted: Mon Mar 30, 2015 11:11 am
by Mr_Noodle
It's definitely under consideration.