Kodi Community Forum

Full Version: NFO / XML import update / documentation update?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
As usual, too much free time at work on a limited workstation has led me to working on XBMC stuff again.

At this page in the manual wiki there's an example of NFO code you can use to effectively create a local database record:
http://www.xbmc.org/wiki/?title=Import_-..._nfo_Files

I am using Sqliteman to fool around with a local copy of my videodb, and noticed a few things when comparing against the example NFO:
-is the "credits" field in the example used for the writer(s)?
-why is there a <filenameandpath> tag in the NFO XML? Wouldn't this value be found during scanning (because the NFO file will be alongside the media it refers to?) just seemed redundant to me...
-The "studio" field from the database is not included in the example NFO. Is it possible to store this value in the NFO files?

I am planning on doing something to generate NFOs for all my movies, so I'd like to make sure I understand things correctly before I get into it deeper. Looks like all the NFO-related stuff is in the movie table of the video database. I am a super n00b when it comes to SQL, so I don't really even know the proper terminology for things Sad
The best thing to do is to export from your db and look at the fields. They've likely been updated since the documentation was written.

And yes, <filenameandpath> is superfluous to an .nfo file.
cool cool, I will harass Sho when I have all the info Smile
jmarshall Wrote:And yes, <filenameandpath> is superfluous to an .nfo file.
unless you plan on exporting the nfo on one Xbox on your local network then import it on a other Xbox that is on the same network, right? http://forum.xbmc.org/showthread.php?tid=29299

Huh
SleepyP Wrote:cool cool, I will harass Sho when I have all the info Smile
I am by no means the proprietor of the wiki Smile

Feel free to add any info/updates you come across yourself.
what I meant by the fileandpath being superfluous is in the context of the XML file residing in the same shared location as the media it refers to, like Aliens.nfo in the same directory with Aliens.avi for example.
Anyways, I have done a test export of the db to XML with a single movie scanned in from IMDB and all the options turned on. Here's what I got, all I have done is remove the huge block of text inside of the various thumb tags, and also edit down the outline and plot items.

Code:
<movie>
    <title>3:10 to Yuma</title>
    <rating>8.100000</rating>
    <year>2007</year>
    <top250>200</top250>
    <votes>34,685</votes>
    <outline>Short summary goes here</outline>
    <plot>Full summary goes here</plot>
    <tagline>Time waits for one man</tagline>
    <runtime>122 min</runtime>
    <thumb></thumb>
    <mpaa>Rated R for violence and some language.</mpaa>
    <watched>false</watched>
    <file></file>
    <path>smb://192.168.0.2/MoviesA/</path>
    <filenameandpath>smb://192.168.0.2/MoviesA/3.10 To Yuma.avi</filenameandpath>
    <episodeguide></episodeguide>
    <id>tt0381849</id>
    <genre>Crime / Drama / Western</genre>
    <credits>Halsted Welles / Michael Brandt / Derek Haas / Elmore Leonard</credits>
    <director>James Mangold</director>
    <premiered></premiered>
    <status></status>
    <code></code>
    <aired></aired>
    <studio>Relativity Media</studio>
    <album></album>
    <actor>
        <name>Russell Crowe</name>
        <role>Ben Wade</role>
        <thumb></thumb>
    </actor>
</movie>

Seems like there's a few TV-related tags that somehow made it in even though this item is explicitly a "movie" as far as XBMC is concerned. Jmarshal, any thoughts on that? The tags I refer are <premiered>, <code>, <aired>, <album>, and <episodeguide>. Unless I am mistaken, those should only be getting tagged onto TV items, right?
just made a wiki account, but I don't think I have editing privledges...
SleepyP Wrote:just made a wiki account, but I don't think I have editing privledges...
PM pike and ask nicely for ninja status Nod
Every tag is exported, even if it contains nothing.
A question along the same lines: what happens if you import stuff from an NFO for an item that is already in the database?
It only adds new items IIRC - not 100% sure though about that. Check the code to be certain (VideoDatabase.cpp ImportFromXML)