Page 1 of 1

Special Epsiode Seasons in thetvdb

Posted: 08 Jan 2015, 16:20
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

Re: Special Epsiode Seasons in thetvdb

Posted: 08 Jan 2015, 19:11
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?

Re: Special Epsiode Seasons in thetvdb

Posted: 11 Jan 2015, 13:41
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.

Re: Special Epsiode Seasons in thetvdb

Posted: 11 Jan 2015, 20:15
by rednoah
I've already updated the code to do something like that.