Create different folder structure for SD and HD TV series

All about user-defined episode / movie format expressions
Post Reply
Wiggles
Posts: 2
Joined: 15 Oct 2018, 14:20

Create different folder structure for SD and HD TV series

Post by Wiggles » 15 Oct 2018, 15:00

Hi

I am currently using this code to naming my TV series episodes to my liking. It auto detects the contents resolution and cleans up the naming.

Code: Select all

Z:/TV/{n.colon(' - ')replaceTrailingBrackets()}/{'Season '+s}/{n.colon(' - ')replaceTrailingBrackets()} - {'s'+s.pad(2)+'e'+es*.pad(2).join('-e')}{' - '+vf.match(/720[pP]|1080[pP]/)} - {t.colon(' - ')}
Better.Call.Saul.S04E10.720p.HDTV.x264-AVS --> Better Call Saul - s04e10 - 720p - Winner

I like to download both SD and HD versions of the same series if I can, and store them in separate folders ("Season 1" and "Season 1 - HD"). The code I am using puts all the episodes from the same season in the same folder, regardless of resolution. Is there any way to make a code that makes an output folder depend on the content it processes?

Something like this
Better.Call.Saul.S04E10.720p.HDTV.x264-AVS --> Z:/TV/Better Call Saul/Season 4 - HD/Better Call Saul - s04e10 - 720p - Winner
Better.Call.Saul.S04E10.HDTV.x264-SVA --> Z:/TV/Better Call Saul/Season 4/Better Call Saul - s04e10 - Winner

(Not like this viewtopic.php?t=6141, as that already have the file structure made, where as the one I want will need to make a new structure for each new season/series it adds)

User avatar
rednoah
The Source
Posts: 16269
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Create different folder structure for SD and HD TV series

Post by rednoah » 16 Oct 2018, 04:13

You could do something like this to add the UHD / HD / SD tag to the season folder:

Code: Select all

{'Season '+s}  - {hd}
Alternatively, you can also do an if-then-else condition and then do whatever you want based on that:

Code: Select all

{hd =~ /HD/ ? "Season ${s}" : "Season ${s} - HD"}
:idea: Please read the FAQ and How to Request Help.

Wiggles
Posts: 2
Joined: 15 Oct 2018, 14:20

Re: Create different folder structure for SD and HD TV series

Post by Wiggles » 16 Oct 2018, 13:48

Thank you. The second was the solution I was looking for (it was written in the wrong order though, creating an HD folder for SD etc).

I dont have any 4k episodes yet but added that too.

Code: Select all

{hd =~ /UHD/ ? "Season ${s} - UHD" : hd =~ /HD/ ? "Season ${s} - HD" : "Season ${s}"}

Code: Select all

Z:/TV/{n.colon(' - ')replaceTrailingBrackets()}/{hd =~ /UHD/ ? "Season ${s} - UHD" : hd =~ /HD/ ? "Season ${s} - HD" : "Season ${s}"}/{n.colon(' - ')replaceTrailingBrackets()} - {'s'+s.pad(2)+'e'+es*.pad(2).join('-e')}{' - '+vf.match(/720[pP]|1080[pP]|2160[pP]/)} - {t.colon(' - ')}
Z:/TV/Better Call Saul/Season 4/Better Call Saul - s04e10 - Winner
Z:/TV/Better Call Saul/Season 4 - HD/Better Call Saul - s04e10 - 720p - Winner
Z:/TV/Better Call Saul/Season 4 - HD/Better Call Saul - s04e10 - 1080p - Winner
Z:/TV/Better Call Saul/Season 4 - UHD/Better Call Saul - s04e10 - 2160p - Winner

Post Reply