Naming TV series with an OR option

All about user-defined episode / movie / file name format expressions
Post Reply
ChefGregS
Posts: 99
Joined: 30 Mar 2016, 11:14

Naming TV series with an OR option

Post by ChefGregS »

I think the subject says what I want to do but this example should make more sense (lol.)

ISSUE: I am naming a series that doesn't have series dates listed. So every time I try to rename it It wants to name every episode as a SPECIAL. Here is my current code:

Code: Select all

M:/TV II/{n.upperInitial().colon(' - ').replace('?', '!') }/{ any{"Season $s $sy" }{'Specials'}}/{n.upperInitial().colon(' - ').replace('?', '!') } {[genres.take(2).join(', ')]} - {s00e00} - {any{[airdate]}{null}} ({"$vf, $ac@$af"}) - {t.colon(" - ").replace('?', '!')}{subt}
The file names DO have a season and an episode listed. Just not a year. So if I am reading it right, the code I am using is looking for the Season and the Year; and if it doesn't find that information it makes it a Special.

I would like it to look and if it finds either the $s or the $sy replace that with the formatting else make it a special. I hope that makes sense.

BUT, I am not 100% sure it will give me the results I want. I mean, what if it has a season (0) but not a year. $s=0 WOULD be a special. Then it would need to check if either the s or sy is used make it a season unless s=0 THEN it is also a special.

Of course, I could be not be thinking about this correctly at all... It has been so long since I studied all this and created my scheme that I may just be missing it altogether. LOL

This really does take me back to my programming days when I was in high school and college and learning how to efficiently program if/then/or/but/unless all using boolean logic. Oh what fun! :) (actually, once you had that ah-ha moment, it really was fun!)

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

Re: Naming TV series with an OR option

Post by rednoah »

:?: What specific series(s) / episode(s) are you testing with and what would the correct season folder be for each of your test cases? (make sure to cover each corner case with a test case)


:?: Perhaps something like this?

Format: Select all

{ any{ "Season $s $sy" }{ "Season $s [No Year]" }{ 'Specials' } }
:idea: Please read the FAQ and How to Request Help.
ChefGregS
Posts: 99
Joined: 30 Mar 2016, 11:14

Re: Naming TV series with an OR option

Post by ChefGregS »

FYI: That code worked. As I read it it made total sense. The second part is just another OR. So if the first, use it, else if the second use it, else use the last. So simple. Thank you.

Ok..so the series I am working with is The Way of the Master. The Christian series with Ray Comfort and Kirk Cameron. I am currently fixing the seasons on thetvdb. So soon the new code won't be needed but until then it works.

The correct folder should be: Drive = (one of several) /TVII/The Way Of The Master/Season 1 [2003]/The Way Of The Master [Documentary] - S01E01 - (720p, AAC@2ch) - The Firefighter.mp4

So currently it sets them to /Season 1 [No Year]/ but once the database updates it will show them correctly.

Greg
Post Reply