Kodi Community Forum
[HOW TO] Library Node Examples - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Tips, tricks, and step by step guides (https://forum.kodi.tv/forumdisplay.php?fid=110)
+--- Thread: [HOW TO] Library Node Examples (/showthread.php?tid=257378)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22


RE: [HOW TO] Library Node Examples - jjd-uk - 2016-03-04

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/addons/resource.language.en_gb/resources/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.


RE: [HOW TO] Library Node Examples - RonnieG3 - 2016-03-05

That makes sense. I just found the Editor. Thanks for the help!!


RE: [HOW TO] Library Node Examples - DaveBlake - 2016-03-05

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.


RE: [HOW TO] Library Node Examples - Ashaneil - 2016-03-06

So what, exactly, is the difference between nodes and playlist? When would you want to use one over the other?


RE: [HOW TO] Library Node Examples - jjd-uk - 2016-03-06

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.


RE: [HOW TO] Library Node Examples - DaveBlake - 2016-03-06

(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!


RE: [HOW TO] Library Node Examples - accagì - 2016-03-18

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!


RE: [HOW TO] Library Node Examples - zigzag930 - 2016-03-23

Is there a way to add multiple conditions with OR?

For example: rules says filename contains MKV OR mp4


RE: [HOW TO] Library Node Examples - LongMan - 2016-03-23

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


RE: [HOW TO] Library Node Examples - zigzag930 - 2016-03-24

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.


RE: [HOW TO] Library Node Examples - Prot0n - 2016-03-30

Shouldn't this rule be showing the TOP 250 Movies?

Image

It isn't working for me...


RE: [HOW TO] Library Node Examples - BobCratchett - 2016-03-30

@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.


RE: [HOW TO] Library Node Examples - zag - 2016-03-30

Easy way is to check the database manually with a sqlite db viewer. Look if the top 250 field is filled.

www.sqlitebrowser.org


RE: [HOW TO] Library Node Examples - Prot0n - 2016-03-31

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!!


RE: [HOW TO] Library Node Examples - zag - 2016-03-31

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