Kodi Community Forum

Full Version: User info in media-stubs
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
A friend and myself both have large DVD collections and ,as well as a digital manager, would like to use Kodi as a media manager. I have created media-stub files for all our physical DVD/Blurays and all works well. However we have some additional personal information which is not recorded in the Kodi database (e.g. purchase-date, purchase-price) which we would also like to store so we can produce HTML or text listings of our collections with this info alongside info extracted from the Kodi database.

I have tried extending media stubs to include <purchaseprice> and <purchasedate> and all seems good. Kodi appears to ignore this (but does display the <title> and <message> fields correctly) and the data is available to my report generating program by locating the correct stub via the links in the Kodi database.

My concern is that extending media-stubs like this will possibly break things in the future if Kodi itself uses more fields in media-stubs. I guess I can have something like <$USER-purchaseprice> in my media stubs but I'm worried that at some future point media-stub processing withing Kodi may become stricter and the code will barf at fields that Kodi itself doessn't recognise. Can I put in a feature request that media-stubs allow user defined info which Kodi ignores. Perhaps this is already the intention but I can't find it explicitly stated anywhere.
By "media stubs", do you mean NFO files? They're xml files so Kodi will ignore anything it doesn't recognise... it would be perfectly OK for you to add your tags to the xml files, you could even create a group tag with a unique name that Kodi would never use, then add your tags within your group. Kodi will never process your tags no matter what they're called, because it will always ignore your group.
Oh - I hadn't come across NFO files, so another interesting avenue to explore :-)

I am using media-stubs - http://kodi.wiki/view/Media_stubs. Basically I parse my DVD Profiler XML to produce a set of files with names such as:
/Kodi_Files/Movie/T/The Bourne Identity(1988).dvd.disc and content:
<discstub>
<title>The Bourne Identity(1988)</title>
<message>Media is located at 1336</message>
<purchasedate>2010-04-01</purchasedate>
<purchaseprice>£2.00</purchaseprice>
</discstub>


The <title> and <message> fields are documented but the <purchasedate> and <purchaseprice> are invented by me*. It appears that Kodi is quite happy to ignore XML it isn't expecting which is perfect (and your comment re NFO files seems to suggest this iis a fundamental part of Kodi's behaviour). My post was really a concern (or my lack of knowledge) as to whether Kodi always ignored unexpected XML so I could use my own fields in media stubs this as a long term solution.

Your reply suggests extending media stubs is OK - thanks.

* These fields are of no interest to Kodi and will not show up anywehere in Kodi but I can produce my own text or HTML listings by querying the Kodi database and also extracting info from these files to build reports with a mixture of Kodi data and personal data.
I'd never heard of media stubs until now... Smile

Ignoring fields/tags that aren't recognised is a fundamental part of XML, hence the X for eXtensible. There shouldn't be any problem extending media stubs, provided there is no conflict with future Kodi tag names.
Wow I never heard of the media stubs either but I plan on adding my entire disc collection using them now that I do know of them.