Special Epsiode Seasons in thetvdb

All about user-defined episode / movie / file name format expressions
Post Reply
conerck
Posts: 2
Joined: 08 Jan 2015, 16:11

Special Epsiode Seasons in thetvdb

Post by conerck »

Hi,

I am having a problem with Special Episodes and the thetvdb as they always seem to be have the {s} attribute set to 0, despite having the field "Airs after Season" on the thetvdb set to a correct value.

E.g.
A file named "Doctor Who (2005) Special 142" will resolve to
Season 00/Doctor Who (2005) - Special 142 - Last Christmas
using the Naming Format
Season {s.pad(2)}/{n} - {episode.special ? 'Special '+special.pad(2) : s00e00} - {t}

I would expect (and hope for) it to be sorted into Season 08 since that particular episode has the field set. See http://thetvdb.com/index.php?tab=episod ... id=5050459
User avatar
rednoah
The Source
Posts: 23002
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Special Epsiode Seasons in thetvdb

Post by rednoah »

Currently {s} will be airsbefore_season if available, or 0 if undefined. Originally there was no airsafter_season but now that there is, which one would make the most sense?
:idea: Please read the FAQ and How to Request Help.
conerck
Posts: 2
Joined: 08 Jan 2015, 16:11

Re: Special Epsiode Seasons in thetvdb

Post by conerck »

How about a double fallback?

pseudo-code:

Code: Select all

if (not_undefined(airsbefore_season)) { 
    return airsbefore_season; 
}
else if (not_undefined(airsafter_season)) {
    return airsafter_season;
}
else {
    return 0;
}
I can't image that both values are set simultaneously for many episodes and even in that case such a solution would yield an acceptable result.
User avatar
rednoah
The Source
Posts: 23002
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Special Epsiode Seasons in thetvdb

Post by rednoah »

I've already updated the code to do something like that.
:idea: Please read the FAQ and How to Request Help.
Post Reply