Thread Rating:
  • 3 Vote(s) - 4 Average
[HOW TO] Library Node Examples
#31
That example uses one of the default installed nodes thus that label is taken from the strings.po file in the resource language addon, for example https://github.com/xbmc/xbmc/blob/master...es/strings.

In this case string 562 is the label Years.

When creating you own nodes you don't needs to use tbese strings, thd label is simply the displayed name for the node in the gui so you cannot type in whatever you want.

Although if you're a total beginner it might be best sticking to the Library Node Editor addon and do it all via the gui, then maybe checking the xml's after to see how they are laid out if you want to learn editing & generating them directly.
Reply
#32
That makes sense. I just found the Editor. Thanks for the help!!
Reply
#33
But AFAIK the editor only edits rule type nodes (like smart playlists) and not folder type nodes (like the default nodes). So learn from the editor, but don't be limited by it.
Reply
#34
So what, exactly, is the difference between nodes and playlist? When would you want to use one over the other?
Reply
#35
Nodes give you complete flexibility to create your own Library structure within the gui, thus it allows you to build yor own hierarchy of parent nodes then each of these parent nodes can contain child nodes for further filtering, or even child of child nodes and so on.
Reply
#36
(2016-03-06, 17:19)Ashaneil Wrote: So what, exactly, is the difference between nodes and playlist? When would you want to use one over the other?

For the difference between custom nodes and smart playlists see #25 where this is asked and answered. But I will assume you were actually asking a new question about folder type nodes and rule based nodes since that was the previous post Smile

The big difference for the user between folder type custom nodes and rule type custom nodes is the drill down behaviour when you select an item. There are internal implementation differences too, the database queries are more efficient on folder type, but what can be achived is more limited than the flexible rules that can be created with the rule type.

Folder type custom nodes exactly mimic the way that the default nodes work. For example say you have very many music genres, pages of them, and so would like to have a special subset of them on a smaller menu for easy access. I would create folder type nodes for this, arranged in a submenu, one for each of my favorite genres.

Code:
<path>musicdb://artists/?genre=Rock</path>

would give me a node that displays exactly the same artists that clicking on a genre of "Rock" on the genre node. If I then drill down and click on an artist I get the albums node showing albums for that artist with songs of that genre. Drill further down I get those songs.

But say you used a rule type node instead.

Code:
<content>artists</content>
<rule field="genre" operator="is">
<value>Rock</value>
</rule>

This would show the same artists as above. However, like with playlists, the rule does not pass to the items below it. So click on an artist and you will see all of their albums regardless of genre, and further down all the songs.

Does this matter? Well if you have an artist than crosses several genres then these two approaches produce quite different results. If you want default node like behaviour you have to use folder type custom nodes.

I hope that makes things clearer for some people. But it is a more advanced topic, so don't be upset if it is less than clear!
Reply
#37
Music 
I wanted the composers on the first level (together with albums etc.) and not hidden in the roles. Krypton offers a simple way to have it, step by step:

- enter node editor (options panel on the left)
- new node, give it a name ("Compositori" for me; I live in Italy)
- still in the editor click the new node
- add path (add content doesn't work, because it doesn't offer neither roles nor composers): musicdb://artists/?role=Composer

I found the path clicking (in the editor) Roles -> Composers

Smile It works!

UPDATE:

Since the node editor currently does not work ( ? A problem of the alpha version ? ) , I opened the xml file and I found that thus the purpose of having e.g. composers on the first level may be reached in an even better way :

- Open the file .kodi / userdata / library / music / musicroles / Composers.xml

< ? Xml version = ' 1.0 ' encoding = ' UTF - 8 ' ? >
<Node order = " 1 " type = "folder" visible = " Library.HasContent (Role , Composer ) " >
<Label > Composers < / label>
<Icon > DefaultMusicGenres.png < / icon >
< Path> musicdb : // artists / ? Role = Composer < / path>
< / Node >

- Delete the "visible " in the second line that the file looks like this

<?xml version='1.0' encoding='UTF-8'?>
<node order="1" type="folder">
<label>Compositori</label>
<icon>DefaultMusicGenres.png</icon>
<path>musicdb://artists/?role=Composer</path>
</node>

- Save it on the first level .kodi / userdata / library / music / Composers.xml

Done!
Reply
#38
Is there a way to add multiple conditions with OR?

For example: rules says filename contains MKV OR mp4
Reply
#39
Use <match>one</match> instead of <match>all</match> and include each condition as a rule. Any item that matches one of the rule will be in the list.

<match>one</match>
<rule field="filename" operator="contains">
<value>mp4</value>
</rule>
<rule field="filename" operator="contains">
<value>mkv</value>
</rule>


Cheers,
LongMan
Reply
#40
Thank you. That worked perfectly.

I had to edit the .xml file directly as the Kodi Node Editor add-on, didn't appear to have any way to accomplish this change.
Reply
#41
Shouldn't this rule be showing the TOP 250 Movies?

Image

It isn't working for me...
Reply
#42
@Prot0n - long time since I tried this, but my memory is that the rule should be 'Top 250' 'Greater Than' '0' (which is to say, movies without top 250 information have their top 250 value set to '0' so need to be excluded.)

Again going off memory here, but I also recall having to use a third-party script to import the top 250 information into the library. This may have changed since.
Reply
#43
Easy way is to check the database manually with a sqlite db viewer. Look if the top 250 field is filled.

http://www.sqlitebrowser.org
Reply
#44
Analyzing my database with the tool @zag proposed I saw that the top 250 field was empty. So I changed the scraper from the default one to the Universal Movie Scraper and this did the trick, it filled the top250 field.

Afterwards, using the rule pointed by @BobCratchett I managed to list all my top 250 movies.

Thanks guys!!
Reply
#45
Could you post the raw XML of the node you made? It should be in userdata/library

This is useful so others can simply copy it Wink
Reply



[HOW TO] Library Node Examples43