Page 1 of 1

Delete folder after unrar

PostPosted: Wed Jan 06, 2016 6:35 am
by MacMatt
Hi All, new user, in *love* with the software. :D

I'm so sorry to ask this, I spent hours today reading up on the forum trying to answer it myself but I am stumped - why won't Hazel move my folders of under 100mb to the trash?

I am a Sonarr fan so I bought the AWESOME Hazel to unrar and clean up after downloading before letting Plex import the .mkv or movie files.

It's all working great, after decompressing it then moves the mkv to the top of my downloads folder, and then Sonarr grabs it and imports it to plex...but I am stumped as to how to get rid of the empty (or near empty) files after an unrar and a move from the sub folder to the top of my download folder so Sonarr can grab a file into plex.

Often torrent folders after unraring have .nfo or .srt files left over, so my last rule is called Trash Torrent Folder and it does this - nothing flash, just check if maybe there is a sample mkv, or an .nfo or srr or srt file (always under 100mb) and then just trash that folder.

HOWEVER: it refuses to trash the subfolder. Any folder in Downloads certainly gets scanned, and Hazel moves the files to the trash, but not the folder?

Why is that? This is my last rule, with all others working beautifully on my Downloads folder ahead of this. I am just left with a folder with no movie, and some misc, useless nfo or srt files that I want gone.

Image

Surely based on that rule my DOWNLOADS folder should now be empty (all are actually, literally empty!)

Image

Re: Delete folder after unrar

PostPosted: Wed Jan 06, 2016 4:00 pm
by Mr_Noodle
Have you checked the preview (the "eye" button)? It might be the case the folder is matching a different rule before this one.

Also, an alternative way to write that rule is to do a nested condition targeting sub-files. Hold down the option key while clicking the + button to create a new condition. That will create a nested condition with an extra pop-up, which specifies the target of the conditions under it. Set to that to "any/all sub-files...". Now, you can add conditions under it to apply to sub-files, like the absence of an mkv file. The rule itself as a whole still applies to the folder, allowing you to have the rule move the folder based on its contents.

Re: Delete folder after unrar

PostPosted: Wed Jan 06, 2016 9:26 pm
by MacMatt
Thanks for the reply, my aim is this
    Unrar a show/movie in my Downloads folder - mostly this is multipart rars in a subfolder folder so, if rars are in a subfolder, then scan and decompress them.
    Move the movie file from the subfolder to the top level Downloads folder for Sonarr to grab
    Delete the show/movie
    Delete the subfolder and any misc files in there like nfo or srt or even a sample movie
    But don't delete sub folders if there are music files in there

Then I'd like Hazel to rub my feet and make me a sandwhich :D But I'll settle for any tips on the smoothest workflow and rules to make the above process happen.

Re: Delete folder after unrar

PostPosted: Thu Jan 07, 2016 1:10 pm
by Mr_Noodle
As outlined before, you can create a rule to match folders based on their contents, so you can do the nested condition with something like "If all are met for all-sub-files, Kind is not Music" will match the folder if there are no music files under it.