[HOW TO] Library Node Examples

  Thread Rating:
  • 3 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
zag Offline
Retired Team-Kodi Member
Posts: 4,006
Joined: Oct 2007
Reputation: 75
Location: UK
Post: #16
Show all albums from a certain decade

For example: all albums from 1990 sorted in year order

C:\Users\username\AppData\Roaming\Kodi\userdata\library\music\1990sdecade.xml
Code:
<?xml version='1.0' encoding='UTF-8'?>
<node order="22" type="filter">
    <label>1990s Decade</label>
    <content>albums</content>
    <rule field="year" operator="greaterthan">
        <value>1990</value>
    </rule>
    <rule field="year" operator="lessthan">
        <value>2000</value>
    </rule>
    <order direction="ascending">year</order>
</node>
find quote
zag Offline
Retired Team-Kodi Member
Posts: 4,006
Joined: Oct 2007
Reputation: 75
Location: UK
Post: #17
And a video guide if you don't want to start messing with XML files.

This is also possible entirely from withing the GUI using the library node editor!



(This post was last modified: 2016-01-31 16:10 by zag.)
find quote
BobCratchett Offline
Posting Enthusiast
Posts: 1,455
Joined: Jan 2015
Reputation: 148
Post: #18
Go directly to a node of an addon

For example, the 'Classic Rock' genre (which is both classic and it rocks) of the Radio.de plugin.

Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="14" type="folder">
  <label>Classic Rock</label>
  <icon>DefaultMusicSongs.png</icon>
  <path>plugin://plugin.audio.radio_de/stations/genre/Classic+Rock/</path>
</node>

A relatively easy way to get the path is to add the node to favourites, then copy it out of the userdata (wiki)/favourites.xml file.

@zag - nice video tutorial, and nice to see that add-on still kicking around Smile But you probably want the first rule to be 'Greater than 1999', so that it includes albums from 2000 to 2009 inclusive.
find quote
DarkHelmet Offline
Posting Freak
Posts: 822
Joined: Jul 2008
Reputation: 6
Location: Hamburg, Germany
Post: #19
Sice nodes and smart playlist have a lot in common. Is it possible to create a mixed node? Smart playlists can consist of mixed content. Music and Music videos in that case.
find quote
zag Offline
Retired Team-Kodi Member
Posts: 4,006
Joined: Oct 2007
Reputation: 75
Location: UK
Post: #20
(2016-02-03 01:12)DarkHelmet Wrote:  Sice nodes and smart playlist have a lot in common. Is it possible to create a mixed node? Smart playlists can consist of mixed content. Music and Music videos in that case.

No, I don't think so.
find quote
tkgafs Offline
Senior Member
Posts: 115
Joined: May 2008
Reputation: 2
Post: #21
Would it be possible to use these nodes as a method of finding incorrect / missing audio tags

for example is it possible to say something like

<rule field="year" operator="0"> or perhaps <rule field="year" operator=NULL>

to find all the songs which do not have a year set
find quote
zag Offline
Retired Team-Kodi Member
Posts: 4,006
Joined: Oct 2007
Reputation: 75
Location: UK
Post: #22
Yep that should work

Please post if you get an example.
find quote
DaveBlake Offline
Team-Kodi Member
Posts: 2,278
Joined: Jun 2015
Reputation: 65
Location: South West England
Post: #23
(2016-02-24 13:32)tkgafs Wrote:  Would it be possible to use these nodes as a method of finding incorrect / missing audio tags
for example is it possible to say something like

<rule field="year" operator="0"> or perhaps <rule field="year" operator=NULL>

to find all the songs which do not have a year set

I commend the desire to improve your music tags Smile

If year is 0 then yes you can find those songs with that kind of rule. But I do need to check that no date tag always results in year = 0, and I'm no so sure that null can be used in a rule like that.
find quote
zag Offline
Retired Team-Kodi Member
Posts: 4,006
Joined: Oct 2007
Reputation: 75
Location: UK
Post: #24
For the Oscars Movie node:

oscars.xml
Code:
<?xml version='1.0' encoding='UTF-8'?>
<node order="10" type="filter">
    <label>Oscars 2016</label>
    <content>movies</content>
    <rule field="filename" operator="contains">
        <value>oscars</value>
    </rule>
</node>

Video Guide




Just add -oscars to the end of any movie filename for it to show up Wink
find quote
incubus Offline
Donor
Posts: 146
Joined: Apr 2012
Reputation: 1
Location: France
Post: #25
If something can be achieved with a smart playlist is there any advantage using a node instead ?

Beebox N3150 - LibreELEC 7.90.009
Synology DS212+ NAS 6TB
Panasonic DMP-BD65 bluray
Yamaha RX-A3030 AVR - Kef KHT3005SE 5.1 speakers
Optoma HD87 projector - Exclusiv-Home 2.8m 16:9 screen
find quote
DaveBlake Offline
Team-Kodi Member
Posts: 2,278
Joined: Jun 2015
Reputation: 65
Location: South West England
Post: #26
(2016-02-27 11:24)incubus Wrote:  If something can be achieved with a smart playlist is there any advantage using a node instead ?

The ability to create your own node menu structure rather than just a long list of smart playlists.

But also remember that there are folder type custom nodes, they can be drilled down from like the default nodes can while smart playlist and rule type nodes can not.
find quote
zag Offline
Retired Team-Kodi Member
Posts: 4,006
Joined: Oct 2007
Reputation: 75
Location: UK
Post: #27
Yes for example you could have:

Movies >> Oscars >> Best Actor
Movies >> Oscars >> Best Actress
Movies >> Oscars >> Best Picture
ect

Structure. That's what makes Nodes really powerful over playlists.
find quote
incubus Offline
Donor
Posts: 146
Joined: Apr 2012
Reputation: 1
Location: France
Post: #28
Ok, thank you both!

Beebox N3150 - LibreELEC 7.90.009
Synology DS212+ NAS 6TB
Panasonic DMP-BD65 bluray
Yamaha RX-A3030 AVR - Kef KHT3005SE 5.1 speakers
Optoma HD87 projector - Exclusiv-Home 2.8m 16:9 screen
find quote
LongMan Offline
Senior Member
Posts: 161
Joined: Apr 2013
Reputation: 0
Post: #29
"Just add -oscars to the end of any movie filename for it to show up"

@Zag,

With UPnP Sharing (Montellese's Work), and using Emby Server, filenames are no longer available. It may be better to use tags. So once you tag it (with Oscars) on the server it will appear on all clients.

Cheers,
LongMan
find quote
RonnieG3 Offline
Senior Member
Posts: 128
Joined: Apr 2013
Reputation: 0
Post: #30
Please be gentle. I know nothing of coding and if this has been asked elsewhere, I apologize in advance.

From the wiki, I saw the example of the default node video/movies/years.xml and saw the following code:

(2016-01-31 15:33)zag Wrote:  <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="3" type="filter">
<label>562</label>
<icon>DefaultYear.png</icon>
<content>movies</content>
<group>years</group>
</node>

Can someone explain the <label>562</label>? What is Label 562? is there a list of them for music and video?

I'm just venturing into nodes, and am trying to see how best to utilize (e.g. I have my animated films and am thing about using nodes instead of sets to group Disney, Marvel, DC, Japanese, etc in a sub menu under Animated Films on my main menu. Maybe). Like I said, just starting to try to understand them and see how they best would fit my needs.

Thanks in advance for your assistance Big Grin
find quote
Post Reply