Keep one of a set of matching files

Talk, speculate, discuss, pontificate. As long as it pertains to Hazel.

Moderators: Mr_Noodle, Moderators

Keep one of a set of matching files Thu Mar 21, 2013 12:13 pm • by leefur
I often end up with 3-6 files for the same episode of a TV show, thanks to my automated downloader. They're all neatly renamed, thanks to Hazel, to something like "The.Walking.Dead.s03e14.mkv", "The.Walking.Dead.s03e14.mkv-2", "The.Walking.Dead.s03e14.mkv-3", etc.

Ideally I'd like to keep the file that used to have 1080 in the name over the one that used to have 720 in the name (and then only one of those – the most recent, since sometimes there are reposts – if there are multiple). Barring that, I'd like to keep the largest of the set, as a proxy for quality.

Any ideas? Very much obliged for the help!
leefur
 
Posts: 7
Joined: Sun Apr 11, 2010 2:10 pm

Re: Keep one of a set of matching files Fri Mar 22, 2013 3:32 pm • by Mr_Noodle
A reminder: please keep questions out of the Tips forum. It's for completed tips, so to speak.

If the files for a particular episode are isolated to a folder (and no other files are in there), you might be able to do something set to target "its enclosing folder" with a "any of its sub-files" condition nested underneath it. Otherwise, I think you'll have to use a script.
Mr_Noodle
Site Admin
 
Posts: 11193
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Keep one of a set of matching files Fri Mar 22, 2013 3:49 pm • by leefur
Oh, oops, my mistake on the forums. I do like to keep things tidy, so my apologies.

I'll see if I can wrangle Automator on this. Thanks!
leefur
 
Posts: 7
Joined: Sun Apr 11, 2010 2:10 pm


Return to Open Discussion