Did Episode.Special Change?

Support for Windows users
Post Reply
DevXen
Power User
Posts: 164
Joined: 12 Oct 2014, 21:15

Did Episode.Special Change?

Post by DevXen »

I've noticed since I have been using the Windows 10 version of Filebot that when I try to name specials it names it isn't putting them in the specials folder. it'll create the series folder path starting at the root folder of the current drive. it also isn't putting it in a specials folder any longer though it's adding the Source.

so on the latest windows 7 version it puts them it in:
H:\TV Shows\Show Name\Season\[Specials] [WEB-DL]\

But on the windows 10 it puts them in:
H:\Show Name\[WEB-DL]

I used the same script on both the Windows 10 and Windows 7 version in testing (I have 2 PCs). and the only thing I can figure is possibly the Episode.Specials changed so it doesn't Recognize it as a special to organize it. no that can't be it i just noticed it's keeping the S00 in the filenames. i'm not sure what has changed between the two to affect it. - this only happens with specials. season episodes are working fine.

i wasn't going to post my script but if episode.special isn't the problem, i have no idea what else it could be. I do want to go in and change a few things like the

any{source}{'No Source'} i read in another post today. i'd also like to find a way to match the full Season put all episodes in the same folder and have it add the source to the season folder as it currently does - but if it has mixed sources have it add them to the same folder and have it labeled as (Mixed) - Though i'm not sure how to do that or if it's even possible.

anyhow, here's my naming script.

Code: Select all

{model.episode.containsAll(episodelist.findAll{it.season == s && it.episode && it.title}) ? 'H:/Live Action/[Naming]/[Finished]/'+(csv('C:/FileBot Settings/TV/TVGenreFolderBasedOnSeriesName.csv').get(n) ?: genre)+'/' : 'H:/Live Action/[Naming]/[Current Seasons]/'+(csv('C:/FileBot Settings/TV/TVGenreFolderBasedOnSeriesName.csv').get(n) ?: genre)+'/' + '/'}{norm = {it.upperInitial().lowerTrail().replaceAll(/[`´‘’ʻ""“”]/, "'").replaceAll(/[:|]/, " - ").replaceAll(/[?]/, "!").replaceAll(/[*\s]+/, " ").replaceAll(/\b[IiVvXx]+\b/, { it.upper()}).replaceAll(/\b[0-9](?i:th|nd|rd)\b/, {it.lower()})}; norm(n).replaceFirst(/^(?i)(The|A|An)\s(.+)/, /$2, $1/).replaceTrailingBrackets()}{' '+n.match(/\([A-Z]+\)$/)}{if (norm(n) != norm (primaryTitle)) ' ('+norm(primaryTitle)+')'}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':""}{if (y) {' ['+y +']'}}{' '+any{"[$certification]"}{"["+$imdb.certification+"]" }.replaceAll('N A','').replaceAll(/^ \d+$/, 'PG-$0')}{" [$rating" + "★]"} [{csv('C:/FileBot Settings/TV/TVNetwork.csv').get(info.network) ?: info.network }]/{[episodelist.findAll{ it.season == s }.airdate.year.min()]} {episode.special ? ' - Season '+s.pad(2)+'/[Specials]' : ' - Season '+s.pad(2)}{" ($source)"}/{csv('C:/FileBot Settings/TV/TVFileShowNames.csv').get(n) ?: norm(n).replaceTrailingBrackets()}{' '+n.match(/\([A-Z]+\)$/)}{' '+n.match(/\([0-9]+\)$/)} {episode.special ? '- S00E'+special.pad(2)+' -' : '- '+s00e00+' -'} {norm(t.replaceAll("\\s*[(]([^)]*)[)]\$", { group, match -> ' (Part '+match.pad(2)+')' }))}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':""}{' (' + file.path.matchAll(/extended|uncensored|remastered|unrated|uncut|unedited|directors.cut|special.edition|unsold.pilot|broadcast.version|alternate.ending|with.original.commercials|reconstructed|with.commercials|unaired.pilot|unaired.episode/)*.upperInitial()*.lowerTrail().sort().join(') (').replaceAll(/ [._]/, " ") + ')'}{" Part $pi"}{" [$minutes Min]"}{airdate.format(" [MM.dd.yyyy]")}{fn.contains('.web.') ? ' '+' [WEB-DL]':""}{" [$source]"}{" [$vf $ac $af]"}
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Did Episode.Special Change?

Post by kim »

You need to debug
use the GUI and 1 by 1 remove stuff until you find the problem

"Binding "s": undefined"

Code: Select all

{episode.special ? ' - Season '+s.pad(2)+'/[Specials]' : ' - Season '+s.pad(2)}
try

Code: Select all

{episode.special ? 'Season '+0.pad(2)+'/[Specials]' : 'Season '+s.pad(2)}
or

Code: Select all

{episode.special ? 'Season 00/[Specials]' : 'Season '+s.pad(2)}
why use:

Code: Select all

{episode.special ? 'S00E'+special.pad(2): s00e00}
when just

Code: Select all

s00e00
same result:
e.g. S00E01
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Did Episode.Special Change?

Post by rednoah »

1.
I'm not aware of any changes to episode.special as {episode} hasn't changed and it still has a special int field. Note that special episodes often don't have a season, so season may or may not be undefined, depending on the episode data that is provided by the selected database.


2.
The {model} binding might help with your off-topic requirement:
viewtopic.php?t=5690#p32388

e.g.

Code: Select all

{model.source}

Code: Select all

{def sources = model.source.minus(null).unique(); sources.size() == 1 ? sources : 'Mixed'}
:idea: Please read the FAQ and How to Request Help.
DevXen
Power User
Posts: 164
Joined: 12 Oct 2014, 21:15

Re: Did Episode.Special Change?

Post by DevXen »

Hmm. so it's working on my Windows 7 Version. but not the windows 10 version.

kim wrote: 30 Sep 2018, 16:59
why use:

Code: Select all

{episode.special ? 'S00E'+special.pad(2): s00e00}
when just

Code: Select all

s00e00
same result:
e.g. S00E01
Oh. it's like that to keep the season number the episode aired in. which until recently worked just fine. now it just wants to put them all in season 00. which i suppose is okay since I am using plex now. i just hate losing the information of the season the special is from.

But i think i found the problem. it's not so much a problem, just something must of changed in how it processes it. I have it set to separate full seasons into a folder and incomplete seasons into a folder. which before was fine as it would put specials in the complete folder. - now it's not triggering for that. so it has no path. so i'm going to need to change the first bit of my script to a 3 way any{} and add the path it should be saving too. i suppose i Could probably do an if statement with episode.special binding i suppose. i dunno. i'll try a few things.

hmm. also need to implement the 3D binding instead of having it do it manually. i'll get to that eventually. don't have many 3D tv shows to worry about. haha.


the model.source is working beautiful. thank you. I remember a couple years ago. i was wanting to do that but I guess it wasn't possible. I'm glad it is now.

Thank you so much for your help once again.
-Dev
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Did Episode.Special Change?

Post by rednoah »

I think the switch from TheTVDB API v1 to TheTVDB API v2 changed that behaviour, since the new API no longer supports information such as "airs_before_season" or "airs_after_season".

You might be able to guess the season based on {airdate} and {episodelist} though. Shouldn't be too complex, but not so easy that I could just type out something working on the spot.

{model} has been around for a while, at least 2-3 years, but it's a bit too meta so difficult to understand unless you have specific use case, hence the lack of documentation on that one.
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Did Episode.Special Change?

Post by kim »

Identify what season a special belongs to:

Code: Select all

{
def belongToSeason = episodelist.find{it.airdate == airdate}.season
"Season ${belongToSeason.pad(2)}"
}
or

Code: Select all

{
def belongToSeason = model.episodelist.flatten().find{it.airdate == airdate}.season
"Season ${belongToSeason.pad(2)}"
}
but only works if on same airdate as other episode
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Did Episode.Special Change?

Post by kim »

looks like this works:

Code: Select all

{
any{def belongToSeason = episodelist.find{it.airdate != null && it.airdate.year == airdate.year}.season;
"Season ${belongToSeason.pad(2)} (${airdate})"}{'No airdate'}
}
DevXen
Power User
Posts: 164
Joined: 12 Oct 2014, 21:15

Re: Did Episode.Special Change?

Post by DevXen »

rednoah wrote: 30 Sep 2018, 19:05 2.
The {model} binding might help with your off-topic requirement:
viewtopic.php?t=5690#p32388

e.g.

Code: Select all

{model.source}

Code: Select all

{def sources = model.source.minus(null).unique(); sources.size() == 1 ? sources : 'Mixed'}
Hey,

I just now found an issue. if there are mutiple seasons/shows that have a different source. WEBRip/DVDRip/etc. it adds Mixed to all of them instead of the correct source per season.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Did Episode.Special Change?

Post by rednoah »

{model} is the entire rename model, and not somehow filtered by series, season, parent folder, etc of the episode object currently being formatted. That's up to you format code.

e.g. take the model and find all model entries where the series / season is the same as the series / season of the episode currently being formatted:

Code: Select all

model.findAll{ it.n == n && it.s == s }
:idea: Please read the FAQ and How to Request Help.
DevXen
Power User
Posts: 164
Joined: 12 Oct 2014, 21:15

Re: Did Episode.Special Change?

Post by DevXen »

rednoah wrote: 14 Oct 2018, 03:21 {model} is the entire rename model, and not somehow filtered by series, season, parent folder, etc of the episode object currently being formatted. That's up to you format code.

e.g. take the model and find all model entries where the series / season is the same as the series / season of the episode currently being formatted:

Code: Select all

model.findAll{ it.n == n && it.s == s }
i've been struggling with this for the past couple hours. i've tried lots of things but this is the most recent:

Code: Select all

{def sources = model.source.minus(null).unique(); model.source.contains(episodelist.findAll{it.season == s && it.episode); sources.size() >= 1 ? sources.size() == 1 ? sources : '[Mixed]' : '[No Source]'}
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Did Episode.Special Change?

Post by rednoah »

1.
This should get you per-series/season sources:

Code: Select all

def sources = model.findAll{ it.n == n && it.s == s }.source.minus(null).unique();

2.
This code doesn't make sense at all. It's also syntactically incorrect. What are you trying to do here?

Code: Select all

model.source.contains(episodelist.findAll{it.season == s && it.episode);
:idea: model.source will give you a List of String objects, such as [DVD, BluRay], so it'll never contains any Episode objects.

If you wanna check for a complete season, it might look like this:

Code: Select all

model.episode.contains(episodelist.findAll{ it.season == s && !it.special });
or

Code: Select all

episodelist.findAll{ it.season == s && !it.special } in model.episode;
:arrow: model.episode can be replaced with model.episodes.flatten() if you need multi-episode file support.
:idea: Please read the FAQ and How to Request Help.
DevXen
Power User
Posts: 164
Joined: 12 Oct 2014, 21:15

Re: Did Episode.Special Change?

Post by DevXen »

Aww.. Thank you. what would it take to get model documentation? I don't have a lot of free time but i might be able to try to help.. I didn't realize model.source had a list of string objects. I thought it would just pull the current source from the file name. not all of them for the whole list that's been loaded. But then to be fair i did'nt even think of trying {model.source} to see what the outcome would be. which is weird for me. i'm usually on top of doing stuff like that. so that was my bad.

But thank you again for your help.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Did Episode.Special Change?

Post by rednoah »

{model} allows you to access any binding for the entire rename model, not just the current entry being formatted.

i.e. any binding {a} that is defined for the current file/episode match, can be accessed via property a of model {model.a} as List for all file/episode matches currently being processed (i.e. what you see in the GUI). So existing documentation of n / s / episode / vc / af / etc applies to model.* just the same.
:idea: Please read the FAQ and How to Request Help.
Post Reply