Terje Bratland wrote:
> This is from my guide.xml:
>
> <programme start="20170821210000 +0200" stop="20170821220000 +0200" channel="C More Series">
> <title lang="nb">Game of Thrones</title>
> <desc lang="nb">Amerikansk eventyrserie fra 2017. Et stort slag venter i sjuende sesong om det fiktive kontinentet Westeros. En knallhard Cersei har akkurat inntatt jerntronen, men fiender truer i alle himmelretninger. Daenerys' flåte seiler over havet, samtidig som Jon fortsetter å samle troppene i nord(n)</desc>
> <credits>
> <actor>Lena Headey</actor>
> <actor>Peter Dinklage</actor>
> <actor>Nikolaj Coster-Waldau</actor>
> <actor>Emilia Clarke</actor>
> </credits>
> <date>2017</date>
> <category lang="nb">Serie</category>
> <episode-num system="xmltv_ns">6.5/7.</episode-num>
> <rating system="NO">
> <value>15</value>
> </rating>
> </programme>
>
> And it gives the output "s7.e6"
That is correct. The xmltv_ns is a 0-index, so season 1 episode 1 is:
<episode-num system="xmltv_ns">0.0.</episode-num>
For those interested, here's the relevant bit from the DTD:
<!-- Episode number
Not the title of the episode, its number or ID. There are several
ways of numbering episodes, so the 'system' attribute lets you specify
which you mean.
There are two predefined numbering systems, 'xmltv_ns' and
'onscreen'.
xmltv_ns: This is intended to be a general way to number episodes and
parts of multi-part episodes. It is three numbers separated by dots,
the first is the series or season, the second the episode number
within that series, and the third the part number, if the programme is
part of a two-parter. All these numbers are indexed from zero, and
they can be given in the form 'X/Y' to show series X out of Y series
made, or episode X out of Y episodes in this series, or part X of a
Y-part episode. If any of these aren't known they can be omitted.
You can put spaces whereever you like to make things easier to read.
(NB 'part number' is not used when a whole programme is split in two
for purely scheduling reasons; it's intended for cases where there
really is a 'Part One' and 'Part Two'. The format doesn't currently
have a way to represent a whole programme that happens to be split
across two or more timeslots.)
Some examples will make things clearer. The first episode of the
second series is '1.0.0/1' . If it were a two-part episode, then the
first half would be '1.0.0/2' and the second half '1.0.1/2'. If you
know that an episode is from the first season, but you don't know
which episode it is or whether it is part of a multiparter, you could
give the episode-num as '0..'. Here the second and third numbers have
been omitted. If you know that this is the first part of a three-part
episode, which is the last episode of the first series of thirteen,
its number would be '0 . 12/13 . 0/3'. The series number is just '0'
because you don't know how many series there are in total - perhaps
the show is still being made!
The other predefined system, onscreen, is to simply copy what the
programme makers write in the credits - 'Episode #FFEE' would
translate to '#FFEE'.
You are encouraged to use one of these two if possible; if xmltv_ns is
not general enough for your needs, let me know. But if you want, you
can use your own system and give the 'system' attribute as a URL
describing the system you use.
Systems proposed in 2013 to refer to common metadatabases in a
common way:
'themoviedb.org' with the content 'movie/1234' to refer to a movie,
'thetvdb.com' with the content 'series/123456' to refer to a series,
'thetvdb.com' with the content 'episode/123456' to refer to one episode
of a series and 'imdb.com' with the content 'title/tt123455' to refer to
a movie, series or episode.
-->
<!ELEMENT episode-num (#PCDATA)>
<!ATTLIST episode-num system CDATA "onscreen">