XBMC NFO format?
#1
I can't seem to find a complete specification of the NFO format for XBMC anywhere. The wiki has a simple example but I have a few questions that I can't find the answer to... specifically:

1) How should an NFO for a multi-episode file be done?
2) What field should be used so that specials can be sorted in the correct watch order? (for BSG, for example)

Is this written in the wiki somewhere?
Reply
#2
To answer question 1

It needs to have 2 of the episode details (<episodedetails>) in the file (or more if there's more then 2 parts)

from the wiki - http://www.xbmc.org/wiki/?title=Import_-_Export_Library
Quote: TV Episodes

The *.nfo must be named exactly as the episode filename (i.e. episodename.avi and episodename.nfo) and in the same folder, allowing multiple episode and *.nfo files within the same folder.
For multi-part episodes, simply add multiple <episodedetails> XML blocks in succession.

What i've done with MIP and UMM is to create a root element that contains those so that it's valid xml. XBMC doesn't require this, but it's a good idea (i think) to keep it valid xml. I call it xbmcmultiepisode.

example of multipart nfo
Code:
<?xml version="1.0" encoding="utf-8"?>
<xbmcmultiepisode xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <episodedetails>
    <fileinfo>
      <lastupdate>0001-01-01T00:00:00</lastupdate>
      <version>0</version>
      <streamdetails />
    </fileinfo>
    <title>The Yanks In The UK (1)</title>
    <season>4</season>
    <episode>1</episode>
    <rating>7.0</rating>
    <plot>Season four begins all the way in England, with Booth speaking at Scotland Yard and Brennan guest-lecturing at the prestigious Oxford University.  Knowing of Booth and Brennan's expertise in their respective fields, local officials ask for their help with a high-profile murder investigation that involves a British heiress.</plot>
    <thumb>http://www.thetvdb.com/banners/episodes/75682/374849.jpg</thumb>
    <watched />
    <credits>Hart Hanson/Karine Rosenthal</credits>
    <director>Ian Toynton / netFOX / TV-14 / </director>
    <aired>2008-09-03</aired>
    <actor>
      <name>Emily Deschanel</name>
      <role>Dr. Temperance Brennan</role>
      <thumb>http://www.thetvdb.com/banners/actors/40624.jpg</thumb>
    </actor>
    <actor>
      <name>David Boreanaz</name>
      <role>Seeley Booth</role>
      <thumb>http://www.thetvdb.com/banners/actors/40622.jpg</thumb>
    </actor>
    <actor>
      <name>T.J. Thyne</name>
      <role>Dr. Jack Hodgins</role>
      <thumb>http://www.thetvdb.com/banners/actors/40623.jpg</thumb>
    </actor>
    <actor>
      <name>John Francis Daley</name>
      <role>Dr. Lance Sweets</role>
      <thumb>http://www.thetvdb.com/banners/actors/86281.jpg</thumb>
    </actor>
    <actor>
      <name>Michaela Conlin</name>
      <role>Angela Montenegro</role>
      <thumb>http://www.thetvdb.com/banners/actors/77750.jpg</thumb>
    </actor>
    <actor>
      <name>Tamara Taylor</name>
      <role>Dr. Camille Saroyan</role>
      <thumb>http://www.thetvdb.com/banners/actors/77749.jpg</thumb>
    </actor>
    <actor>
      <name>Eric Millegan</name>
      <role>Dr. Zack Addy</role>
      <thumb>http://www.thetvdb.com/banners/actors/40625.jpg</thumb>
    </actor>
    <actor>
      <name>Jonathan Adams</name>
      <role>Dr. Daniel Goodman</role>
      <thumb>http://www.thetvdb.com/banners/actors/40621.jpg</thumb>
    </actor>
    <votes />
  </episodedetails>
  <episodedetails>
    <fileinfo>
      <lastupdate>0001-01-01T00:00:00</lastupdate>
      <version>0</version>
      <streamdetails />
    </fileinfo>
    <title>The Yanks In The UK (2)</title>
    <season>4</season>
    <episode>2</episode>
    <rating>6.5</rating>
    <plot>With the case of the murdered heiress solved, Booth and Brennan prepare to head back home, but are shocked to learn of another murder - and this time it's someone they know.  Meanwhile, with Birimbau unexpectedly coming back into Angela's life, things get complicated between her and Hodgins.</plot>
    <thumb>http://www.thetvdb.com/banners/episodes/75682/374850.jpg</thumb>
    <watched />
    <credits>Stephen Nathan/Scott Williams</credits>
    <director>Ian Toynton / netFOX / TV-14 / </director>
    <aired>2008-09-03</aired>
    <actor>
      <name>Emily Deschanel</name>
      <role>Dr. Temperance Brennan</role>
      <thumb>http://www.thetvdb.com/banners/actors/40624.jpg</thumb>
    </actor>
    <actor>
      <name>David Boreanaz</name>
      <role>Seeley Booth</role>
      <thumb>http://www.thetvdb.com/banners/actors/40622.jpg</thumb>
    </actor>
    <actor>
      <name>T.J. Thyne</name>
      <role>Dr. Jack Hodgins</role>
      <thumb>http://www.thetvdb.com/banners/actors/40623.jpg</thumb>
    </actor>
    <actor>
      <name>John Francis Daley</name>
      <role>Dr. Lance Sweets</role>
      <thumb>http://www.thetvdb.com/banners/actors/86281.jpg</thumb>
    </actor>
    <actor>
      <name>Michaela Conlin</name>
      <role>Angela Montenegro</role>
      <thumb>http://www.thetvdb.com/banners/actors/77750.jpg</thumb>
    </actor>
    <actor>
      <name>Tamara Taylor</name>
      <role>Dr. Camille Saroyan</role>
      <thumb>http://www.thetvdb.com/banners/actors/77749.jpg</thumb>
    </actor>
    <actor>
      <name>Eric Millegan</name>
      <role>Dr. Zack Addy</role>
      <thumb>http://www.thetvdb.com/banners/actors/40625.jpg</thumb>
    </actor>
    <actor>
      <name>Jonathan Adams</name>
      <role>Dr. Daniel Goodman</role>
      <thumb>http://www.thetvdb.com/banners/actors/40621.jpg</thumb>
    </actor>
    <votes />
  </episodedetails>
</xbmcmultiepisode>

For specials and keeping them in the correct order, I would guess the best way would be absolute order (I haven't implemented that so not sure if it's possible in xbmc)

Or it might be possible to sort by aired on date for episodes as well.
Reply
#3
<displayseason> and <displayepisode>

and technically having several sibling items is surely not invalid xml. but yeah, sure, for purists, adding any <tag> around <episodedetails> works.
Reply
#4
There should be a DTD (Document Type Definition) for the NFO.
This would definitely help folks understand the rules.... and develop XML tools that conformed to formal set of rules.
Reply
#5
the words 'there should' does not fly around here without accompanying diff files
Reply
#6
I'd be happy to produce the DTD for it.

only someone has to give me the NFO spec first! (the tail wagging the dog I think)
Reply
#7
You can start working from the example above perhaps? What else do you need exactly?

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#8
On the case!

I can produce a rough DTD from the above (and I shall)... but a DTD should really specify the finer nuances too... e.g. if the elements occur 0 or 1, 1, or 1..n times, in any specific order etc.

I'll get the DTD done and put in values for what I 'believe' to be the case, it can always be updated when the code proves otherwise :-)
Reply
#9
Sounds good - look forward to it.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#10
OK here's the XML Schema for TV Shows (I used XML Schema instead of DTD, since it's the 'latest thing' and supercedes DTD).

Using this, with fancy XML editors, you can ensure a TV Show NFO file conforms to the rules, and in theory, 3rd party NFO editors can use Schema based forms editor to edit the elements (fill in the NFO).
In practice, it's not that simple... because GUI designers want a pretty UI, not some boring forms interface, and so they start making hard coded assumptions on the elements available etc.

Either way, using XML Schema would/should be the best way to document the NFO structure.... because it allows the 'rules' to be clearly stated...i.e. CAN you have multiple director elements or not?... what is the maximum season number supported? etc etc

One thing that MUST be said of XML.... the folks who promoted XML as 'readable' and 'efficient' where clearly wrong. It's actually a little messy to read, and in no way efficient! but still... that's another story.




Code:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="multiepisode">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="episodedetails" minOccurs="1" maxOccurs="unbounded">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="fileinfo" minOccurs="1" maxOccurs="1">
                                <xs:complexType>
                                    <xs:sequence>
                                        <xs:element name="lastupdate" minOccurs="1" maxOccurs="1"
                                            type="xs:date"/>
                                        <xs:element name="version" minOccurs="0" maxOccurs="1"
                                            type="xs:integer"/>
                                        <xs:element name="streamdetails" minOccurs="0" maxOccurs="1"
                                            type="xs:string"/>
                                    </xs:sequence>
                                </xs:complexType>
                            </xs:element>
                            <xs:element name="title" minOccurs="1" maxOccurs="1" type="xs:string"/>
                            <xs:element name="season" minOccurs="1" maxOccurs="1">
                                <xs:simpleType>
                                    <xs:restriction base="xs:integer">
                                        <xs:minInclusive value="0"/>
                                        <xs:maxInclusive value="99"/>
                                    </xs:restriction>
                                </xs:simpleType>
                            </xs:element>
                            <xs:element name="episode" minOccurs="1" maxOccurs="1">
                                <xs:simpleType>
                                    <xs:restriction base="xs:integer">
                                        <xs:minInclusive value="0"/>
                                        <xs:maxInclusive value="99"/>
                                    </xs:restriction>
                                </xs:simpleType>
                            </xs:element>
                            <xs:element name="rating" minOccurs="0" maxOccurs="1" type="xs:string"/>
                            <xs:element name="plot" minOccurs="0" maxOccurs="1" type="xs:string"/>
                            <xs:element name="thumb" minOccurs="0" maxOccurs="1" type="xs:string"/>
                            <xs:element name="watched" minOccurs="0" maxOccurs="1" type="xs:boolean"/>
                            <xs:element name="credits" minOccurs="0" maxOccurs="1" type="xs:string"/>
                            <xs:element name="director" minOccurs="0" maxOccurs="unbounded"
                                type="xs:string"/>
                            <xs:element name="aired" maxOccurs="1" minOccurs="0" type="xs:date"/>
                            <xs:element name="actor" minOccurs="0" maxOccurs="unbounded">
                                <xs:complexType>
                                    <xs:sequence>
                                        <xs:element name="name" minOccurs="1" maxOccurs="1"
                                            type="xs:string"/>
                                        <xs:element name="role" minOccurs="0" maxOccurs="unbounded"
                                            type="xs:string"/>
                                        <xs:element name="thumb" minOccurs="0" maxOccurs="1"
                                            type="xs:string"/>
                                    </xs:sequence>
                                </xs:complexType>
                            </xs:element>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>
Reply
#11
Cool - mind posting this on trac so that we can easily refer to it. We can continue to update it and verify it etc from there.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#12
jmarshall Wrote:Cool - mind posting this on trac so that we can easily refer to it. We can continue to update it and verify it etc from there.

Cheers,
Jonathan


Certainly... once I figure how to use it again!

I'm not sure it's going to be helpful for most folks.... because I think they hard code the XML, but in theory, the XBMC dev team could say "validate your NFO against this Schema" (assuming that XBMC itself conforms to it)

I'll suppose there needs to be a schema for:
movie.nfo
tvseries.nfo
tvseason.nfo? <-- don't think this exists but probably should
tvepisode.nfo
musicartist.nfo
musicalbum.nfo
musictrack.nfo?
Reply
#13
AnalogKid Wrote:Certainly... once I figure how to use it again!

I'm not sure it's going to be helpful for most folks.... because I think they hard code the XML, but in theory, the XBMC dev team could say "validate your NFO against this Schema" (assuming that XBMC itself conforms to it)

I'll suppose there needs to be a schema for:
movie.nfo
tvseries.nfo
tvseason.nfo? <-- don't think this exists but probably should
tvepisode.nfo
musicartist.nfo
musicalbum.nfo
musictrack.nfo?
Has this progressed? I'm developing a translator for nfo to ID3 "TAG" file (as used by Netgear on the EVA and NEO media streamers) and working from the two examples provided (plus some donated by folks wanting the feature) leaves me with little confidence that I've handled all the structures I'm likely to encounter. A definitive DTD/XSD would be very helpful.
Reply
#14
jmarshall Wrote:You can start working from the example above perhaps? What else do you need exactly?

Cheers,
Jonathan

Documentation
Reply

Logout Mark Read Team Forum Stats Members Help
XBMC NFO format?0