Request a little help from a GUI format guru!

Any questions? Need some help?
User avatar
rednoah
The Source
Posts: 22986
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Request a little help from a GUI format guru!

Post by rednoah »

1.
I'd do something like:

Code: Select all

{fn.after(n).after(t).match(/whatever/)}
2.
FileBot doesn't drop anything, but I'm pretty sure TheTVDB only adds (1) (2) ... to proper double episodes (i.e. two episodes with the same title) but if the title is different that's generally omitted, and thus it's impossible to tell what is a double episode and what isn't for those episodes.

In the case where multiple episodes are mapped to a single file you can use {episodes} to access individual episode data. Default bindings like {t} will coalesce the data. I'd start by playing with {episodes*.title} and see what the per-episode data says. ;)
:idea: Please read the FAQ and How to Request Help.
DavidRTurner
Power User
Posts: 85
Joined: 01 Feb 2014, 16:59

Re: Request a little help from a GUI format guru!

Post by DavidRTurner »

rednoah wrote:1.
I'd do something like:

Code: Select all

{fn.after(n).after(t).match(/whatever/)}
I've been playing with it today; it's closer, but I also add special formatting to some shows, that a different rule needs to cover (I forgot to mention it).
I've almost got it done...

rednoah wrote:2.
FileBot doesn't drop anything, but I'm pretty sure TheTVDB only adds (1) (2) ... to proper double episodes (i.e. two episodes with the same title) but if the title is different that's generally omitted, and thus it's impossible to tell what is a double episode and what isn't for those episodes.
There are plenty of references to "Start (1)" and "Finish (2)" titles on theTVDB - Andromeda is a good example of this: http://thetvdb.com/?tab=seasonall&id=77544&lid=7

So I'm still looking to return "S01E01 - Start (Part1) & Finish (Part 2)" or when the title is the same-name, "S01E01 - Title (Part 1 & 2)" - so (ideally) a different case for 2 types of title name.
Once I have the fields pulling in, I can parse them myself (I'm getting better at this! ;) )
The next part below, addresses this...
rednoah wrote:In the case where multiple episodes are mapped to a single file you can use {episodes} to access individual episode data. Default bindings like {t} will coalesce the data. I'd start by playing with {episodes*.title} and see what the per-episode data says. ;)
Cool - I've looked at 'episodes*.title' and it does expand the full title into the double-episode. Now I just need to parse it my own way.


FOLLOW-UP QUESTIONS:
1) what (sub?)-bindings are available for {episode/s} ? .special, .title,... others? Is there a post here with a list?
2) is {t} designed to drop the part references if all are present? Just curious if that's a code of yours in FB itself, or something with the API...

Thank you!!!!!

P.S. I think I'm down to the last 0.5%... I might even reach 99.9% !!!
User avatar
rednoah
The Source
Posts: 22986
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Request a little help from a GUI format guru!

Post by rednoah »

If you go to http://www.filebot.net/naming.html and then check the "source" links you'll see exactly what bindings are implemented how. If you want to know what fields Episode objects have you probably need to check the code.

Though the {json} binding should also show you all you need. ;)
:idea: Please read the FAQ and How to Request Help.
DavidRTurner
Power User
Posts: 85
Joined: 01 Feb 2014, 16:59

Re: Request a little help from a GUI format guru!

Post by DavidRTurner »

Beautiful! ...and very, very useful to see the code!

I now "THINK" I have everything I need for my 99.9% !!

I must run the collection once more to catch any oddballs, but thank you so much!!
Will share when ready...
DavidRTurner
Power User
Posts: 85
Joined: 01 Feb 2014, 16:59

Re: Request a little help from a GUI format guru!

Post by DavidRTurner »

EDIT - I seem to have resolved this (a few hours later) by using a tilde instead of a curly bracket for each side of the string; and using indexOf and lastIndexOf to distinguish them.
This is a workaround, not a solution, though.
My need here, was to use a character (or sequence of characters, which could be even more confusing) that's not likely to be part of a legitimate show/episode name.
But while the curly brackets would WORK in the GET of the subtring, I was unable to find any way to check if they exist first - i.e. "if special string with curlies, then return what's between them, else do other things".
As a special character, it had to be escaped first, but everything I tried (& found online) failed to work in Groovy.
So - all is good now with the format, even though I'd still like to find out why I couldn't escape the curlies...


ORIGINAL POST -
OK, I thought I had everything working correctly, but I've found a glitch & could use some help, as my research comes up empty.

I use a (personal choice) convention to manually add notes to some filenames, to indicate that they are related to an episode in the season, but are not database-relevant.
That is; when some shows do crossover episodes, they relate to each other, but are not (all) listed in each show's database.
For example, Chicago PD S02E07 was part 3 of a 3-show crossover among the 3 related Chicago shows - Chicago Fire was part 1, Law & Order: SVU was part 2, and Chicago PD was part 3.
I will get the 'other' episodes, so I can watch the whole storyline, and keep them in the same folder as the Chicago PD episode.
I will get the properly-formatted name for all 3, then (MANUALLY) insert the Chicago PD episode SxxExx reference to the other 2, so that they all sort alphabetically.
To show that there's something odd here, I add an a/b/c... to the SxxExx number.
I also add a '{' and '}' to the 'other' show's info, and keep a regex in the format to 'keep' that substring intact if the collection is later renamed.
i.e. Chicago P.D. S02E07a - S02E07 (2014, US, NBC, TheTVDB, #269641) -- They'll Have to Go Through Me (Part 3) {Chicago Fire S03E07 - Nobody Touches Anything [2014-11-11]} [2014-11-12] [Crime, Drama]

What I use is this snippet:

Code: Select all

{fn.getAt((fn.indexOf('{'))..(fn.indexOf('}')))}
It finds the index of each of the curly brackets, and 'gets' the substring between them to carry to the new filename.
Problem1 is: using GetAt(, I find I get a trailing character (often a ']', but sometimes a letter (I do not know where it comes from!) at the end of the results line of episodes that do NOT have this curly-bracket string in the filename.
Problem2 is: using Get( eliminates the trailing character, but fails to keep the substring, so I have to switch to GetAt whenever I cross these special episodes.

This Getxx( is the only function I've found that can do this, but there must be another way that covers both scenarios.
Post Reply