Custom Tags in NFO file
#1
I'm new to this stuff but I'm trying to learn with the idea that one day I might create my own skin so please be gentle...

I have what is probably a very basic question regarding tagging in the NFO file. I would like to create some custom tags which I can then access in the Includes_MediaFlags.xml file, I had thought this would be fairly simple but I think I am missing a vital piece of info.

Take the following example:

Code:
<control type="image" id="81">
    <include>Furniture_ShowcaseMediaFlagsVars</include>
    <texture>flags/20thcenturyfox.png</texture>
    <visible>substring(listitem.studio,Fox)</visible>
</control>

Here we are listening for a substring of "Fox" and setting the flag/20thcenturyfox.png What if I wanted to listen to a different tag in my NFO file (i.e. <yoda></yoda>) for the substring, I thought it would be as easy as the following.

Code:
<control type="image" id="81">
    <include>Furniture_ShowcaseMediaFlagsVars</include>
    <texture>flags/20thcenturyfox.png</texture>
    <visible>substring(listitem.yoda,Fox)</visible>
</control>


However, this doesn't work so I now assume that there is another file somewhere that defines the tags source in the NFO file that are used here but I don't seem to be able to find them.

Could someone please point me in the right direction or tell me that this is not possible, needs a code mod etc... been tearing my hair out for a while!

Cheers
Jason
Reply
#2
omega750 Wrote:I'm new to this stuff but I'm trying to learn with the idea that one day I might create my own skin so please be gentle...

I have what is probably a very basic question regarding tagging in the NFO file. I would like to create some custom tags which I can then access in the Includes_MediaFlags.xml file, I had thought this would be fairly simple but I think I am missing a vital piece of info.

Take the following example:

Code:
<control type="image" id="81">
    <include>Furniture_ShowcaseMediaFlagsVars</include>
    <texture>flags/20thcenturyfox.png</texture>
    <visible>substring(listitem.studio,Fox)</visible>
</control>

Here we are listening for a substring of "Fox" and setting the flag/20thcenturyfox.png What if I wanted to listen to a different tag in my NFO file (i.e. <yoda></yoda>) for the substring, I thought it would be as easy as the following.

Code:
<control type="image" id="81">
    <include>Furniture_ShowcaseMediaFlagsVars</include>
    <texture>flags/20thcenturyfox.png</texture>
    <visible>substring(listitem.yoda,Fox)</visible>
</control>


However, this doesn't work so I now assume that there is another file somewhere that defines the tags source in the NFO file that are used here but I don't seem to be able to find them.

Could someone please point me in the right direction or tell me that this is not possible, needs a code mod etc... been tearing my hair out for a while!

Cheers
Jason

The reason this doesn't work is because <yoda /> is not being imported into your Library. Since there is no column called yoda in your table, this will not work.

All the xml tags in the nfo correspond to an existing column in the table. That is why people were putting resolution information in the studio tag before it was supported by XBMC. If it were that simple, they would have used something like <resolution /> instead of putting the info in the <studio /> tag.

-Pr.
[4 Kodi Clients + 4 Norco RPC-4224 Media Servers w/376 TB HDD Space]
Reply
#3
Thanks Pr.Sinister, could you tell me where I might find/work out a list of columns that are available in the table? Is this documented somewhere in a data model?
Reply
#4
omega750 Wrote:Thanks Pr.Sinister, could you tell me where I might find/work out a list of columns that are available in the table? Is this documented somewhere in a data model?

They are all here : http://wiki.xbmc.org/?title=The_XBMC_Database

-Pr.
[4 Kodi Clients + 4 Norco RPC-4224 Media Servers w/376 TB HDD Space]
Reply
#5
Thanks Pr.

Ok, I downloaded SQLiteStudio and been rummaging around in the database and now have a few more questions.

Take the original example:

Code:
<control type="image" id="81">
    <include>Furniture_ShowcaseMediaFlagsVars</include>
    <texture>flags/20thcenturyfox.png</texture>
    <visible>substring(listitem.yoda,Fox)</visible>
</control>

I see that yoda does not exist as a field in the movie table so I can access in this way. So, what if I want to extend my local database movie table with an extra field, do I have to do any mapping to get the data in from the NFO file and if so where, is this code or an entry in an XML file?

Secondly, I see that in the studio example, there are two other additional tables in the database studio and studiolinkmovie. The first stores all the created studios including entries like bluray which have obviously been created based on the entries in the movie.studio column and the second is a link table for studios and movies tables.

Therefore, say I wanted to go further and create an additional table with link table lets say one for audio (i.e. English, AC3, 6CH) and one for video (i.e. 720p, WMV3, 2.35:1, Bluray) would I need to do some coding (if so where) to actually populate this from the NFO file eg.

Code:
<fileinfo>
  <streamdetails>
    <video>
      <format>Bluray</format>
      <resolution>720p</resolution>
      <codec>WMV3</codec>
      <aspect>2.35:1</aspect>
    </video>
    <audio>
      <language>English</language>
      <codec>AC3</codec>
      <channels>6</channels>
    </audio>
  </streamdetails>
</fileinfo>

Assuming I can do that, how would I then define this source in the Includes_MediaFlags.xml would I also need to define this in a different XML file or do some further codingHuh

Many thanks
Jason
Reply
#6
if you want to create additional items you need to recode the c++ of xbmc to
A) look for it in the nfo file
B) Store it
C) make it available to the skin

You can't just make stuff up and assume it will work
Reply
#7
Jezz_X Wrote:if you want to create additional items you need to recode the c++ of xbmc to
A) look for it in the nfo file
B) Store it
C) make it available to the skin

You can't just make stuff up and assume it will work

I think if you look over the posts Pr.Sinister has already answered the question - and no I was not just making stuff up but rather providing an example so people could understand my question.

Now what I am looking for is a bit of further help, when I made my first post I wasn't aware that the .nfo files were mapped directly to database fields I just assumed the XBMC application looked at the file directly and it was just a question of changing the XML file to map it to another tag.

Therefore, your a, b, & c statements are actually the questions that I am looking for answers to..

a) what/where do I need to make changes to make XBMC aware of new tags in the .nfo file
b) where do I need to make the modifications to store it into the database (modifying the database is the easy bit)
c) what do I need to configure (i.e. XML files) or where do I need to change the code to make it available to the skin

As I said in the first post I'm new to this so please play nicely... everyone has to start somewhere!

cheers
omega750
Reply
#8
omega750 Wrote:I think if you look over the posts Pr.Sinister has already answered the question - and no I was not just making stuff up but rather providing an example so people could understand my question.

Now what I am looking for is a bit of further help, when I made my first post I wasn't aware that the .nfo files were mapped directly to database fields I just assumed the XBMC application looked at the file directly and it was just a question of changing the XML file to map it to another tag.

Therefore, your a, b, & c statements are actually the questions that I am looking for answers to..

a) what/where do I need to make changes to make XBMC aware of new tags in the .nfo file
b) where do I need to make the modifications to store it into the database (modifying the database is the easy bit)
c) what do I need to configure (i.e. XML files) or where do I need to change the code to make it available to the skin

As I said in the first post I'm new to this so please play nicely... everyone has to start somewhere!

cheers
omega750

I can't help with your question about where you need to look, but If you know how to code C++ you should be able to find it?
Reply
#9
the real issue is unless the changes you make get accepted by team xbmc and merged into the main code (no guarantee of that) then it will only ever work for you because no one else will have your code unless you start releasing your own custom versions of xbmc to go with your skin.

As for where to find it I also have no clue because I don't know c++ and the xbmc code base is huge
Reply

Logout Mark Read Team Forum Stats Members Help
Custom Tags in NFO file0