Page 1 of 1

Wildcards in Move/Sort into Subfolder question

PostPosted: Mon Nov 16, 2020 7:24 pm
by Aquenon
Hi,
I rip all of my discs once I get them and I’m trying to completely automate them once they’re ripped. I was originally using the TV app to move them into their proper place even though I use Plex. It was just an easy way to move them as it’s already built in. Unfortunately, the TV app does not handle special episodes in a way that Plex likes. Moreover, it puts them in season 1 in the TV app itself which iTunes didn’t do.

But because Plex needs special episodes in a Season 0 folder inside the Series_Name folder, and because the TV app puts them directly in the Series_Name folder, Plex shows them on the media players as being in Season 1. I cannot correct this behavior in the TV app.

What I need is a rule that moves it to the TV library which in my case is /Media/Series/. This is easy. But I need it to go further and drop it into /Media/Series/Showname/Season#/. For example, the DVD set I am currently working on is Mama’s Family. So the name formats are like this: Mama’s Family S01E12.m4v.

In the case of this example, I need it to move it to /Media/Series/Mama’s Family/Season 1/Mama’s Family S01E12.m4v

I can’t figure out how to do that with the Sort into Subfolder command after the Move command. How do I get Hazel to know what’s the name of the show and what’s the season number?

I have a ton of Series to rip and getting this automation running is going to be the difference in me getting it done and me just not feeling like doing it because of all the manual moving.

Thanks,
Scott

PS: I *love* Hazel. I use it all the time and it just always works. This is just one area I cannot figure out how to do it.

Re: Wildcards in Move/Sort into Subfolder question

PostPosted: Mon Nov 16, 2020 8:31 pm
by Mr_Noodle
Look up "match patterns" in the manual. Using those, you can set up custom attributes to match parts of the filename. You can then re-use those custom attributes in the Sort into subfolder pattern. Give it a shot and report back if you run into problems.

Re: Wildcards in Move/Sort into Subfolder question

PostPosted: Sat Nov 21, 2020 8:11 pm
by Aquenon
I’ve been working on it. I’ve been using match patterns for some rules for a while now. I did not know that custom patterns carried down to the rest of the rule, which is pretty cool. Unfortunately, I still cannot figure out how to get it to do what I need. Everything I try with matching the filename matches the filename as a whole, but I need to parse the filename and pull out bits and pieces to carry them down to the action portion of the rule.

For example, I am using the Mama’s Family S05E01.m4v file.
I use the custom attribute, which is [...] S[1][1]E[1][1].m4v.
When I move it to the destination folder of Test, and then sort into Subfolder using the custom attributes, the results are this:

Test/
Mama’s Family S05E01/
Mama’s Family S05E01.m4v

But what I need it to do is this:

Test/
Mama’s Family/
Season 05/
Mama’s Family S05E01.m4v

But I can’t find an option to use matches in a contains fashion. So I need to find a way to break out the Series Name into a custom attribute called Series Name, and I need to break out the 2 digits after S into a custom attribute called Season. If I could get these two attributes broken out, I could combine them to get the results I need.

Is this possible?

Thanks,
Scott

Re: Wildcards in Move/Sort into Subfolder question

PostPosted: Mon Nov 23, 2020 1:07 pm
by Mr_Noodle
Use more than one custom attribute to match each part. Then use the individual attributes separately.

Re: Wildcards in Move/Sort into Subfolder question

PostPosted: Mon Nov 23, 2020 2:19 pm
by Aquenon
That’s the problem, though. I can’t because when selecting filename, the choices I get are ‘matches’ and ‘does not match’. Contents, on the other hand, has the options ‘contain match’ and ‘does not contain match’.

I try to get by that limitation by making a rule ‘does not match seasonAttribute’ where seasonAttribute is a custom attribute matching s[1][1] for example. Since the filename contains more than the season number, it won’t match, but it does have the effect of letting me use that custom attribute in the actions section.

However, that would result in a rule that is ‘Sort into Subfolder Season seasonAttribute’ and try to sort into a folder called Season S00, when I needs to be Season 0 or Season 00. As much as I have worked on this, I cannot figure out how to break out the two digits after the s in s##e## into a custom attribute. If I just made seasonAttribute match [1][1], then what’s stopping it from grabbing the episode number instead of the season number? And in cases of series with numbers in the name, such as That 70’s Show, it could pull out the 70 instead of the season number. That is a series I still need to rip, so it’ll come up. I just can’t figure out how to break out that season number without also getting the s as well.

Also, I can’t figure out how to break out the series name, which I’ll also need. I can use the word [abc] pattern, but series names can have any number of words in them as well as numbers and symbols. I can build a pattern that is [...] s[1][1]e[1][1].m4v which easily matches any file I have in the context, but trying to pull just the name into a custom attribute and leaving out the rest is not something I’ve figured out yet. It’s the same problem as they season number, in truth.

The last problem is when I set a custom attribute into the ‘Sort into Subfolder’ action, it won’t create the folder if it’s not there and I don’t see the option of enabling that behavior.

Can this be done?

Re: Wildcards in Move/Sort into Subfolder question

PostPosted: Mon Nov 23, 2020 4:11 pm
by Mr_Noodle
When doing Name matches, your whole pattern needs to cover all the text in the Name. But that doesn't mean your custom attribute has to. Say you have "blah487" as the text. You can specify a pattern like:

(•first word)(123)

the (•first word) custom attribute is set up to only match a word. while (123), which is outside of the custom attribute, will match the number part after. If you use (•first word), it will just have "blah" and not the number part because that part is outside the custom attribute.

Check other threads on here about dealing with TV shows, as there are probably examples there.

Re: Wildcards in Move/Sort into Subfolder question

PostPosted: Wed Dec 16, 2020 3:30 pm
by Aquenon
Thanks. That helped. I finally got to it again and your last reply helped me to see how to set the variables. It’s easy once you figure it out. All variables need to be set in the conditional part, not the action part. I set the condition as follows:

If all of the following conditions are met
Filename matches •Showname S•Season#E•Episode#.m4v

Where the •Showname variables matches anything, the space between the Showname and the season/episode is broke out by “ S”, the Season# is whatever comes after the S but before the E. After that, I plugged the same variables into the Sort into Subfolder actions and it worked perfectly.

It takes me a while at times trying to figure it out by text, but I eventually get it. Made getting my degree online difficult. Lol.

Anyway, Thanks!