Audio nodes

From Official Kodi Wiki
Jump to: navigation, search
Home icon grey.png   ▶ Music library ▶ Navigation ▶ Audio nodes

Audio nodes are defined views that are used to organize your media from the music menu. In the past Kodi has had a number of standard nodes such as Artist, Album, Tracks that were hard coded. As of v15 Isengard, Kodi introduces the ability to customize these nodes using an XML file. Using XML files really gives great flexibility in how you display your media and lets you browse large collections quickly. Don't want your country music in your main album node... exclude it. Want a genre in a separate node, create it. Don't like how Top 100 Played is presented, change it.

To get full functionality from custom nodes, you need to use a skin that allows you to deploy them as you would like (e.g. latest builds of Aeon Nox). Confluence will show your nodes, but doesn't allow you to decide exactly where.

Contents

1 Audio node editor add-on

Users can now create and edit audio nodes from within Kodi thanks to the add-on Library Node Editor.

2 Technical documentation

2.1 Default audio nodes

The standard audio nodes

You can find a copy of the default nodes in one of two ways. One is to download all or some of the nodes you want form https://github.com/xbmc/xbmc/tree/master/system/library .

The other way is to copy the Kodi system default nodes that come with Kodi, shown in the table below:


Operative system default nodes paths
Android  ?
iOS - Varied /Applications/XBMC.frappliance/XBMCData/XBMCHome/system/library/
/Applications/XBMC.app/XBMCData/XBMCHome/system/library/
Linux /usr/share/xbmc/system/library/
Mac OS X /Applications/XBMC.app/Contents/Resources/XBMC/system/library/
Windows (32bit) C:\Program Files\XBMC\system\library\
Windows (64bit) C:\Program Files (x86)\XBMC\system\library\


To understand nodes a little better, lets take a look at one of the defaults. As an example take a quick look at the system/library/music/genres.xml node in its simplest form:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="1" type="filter" visible="Library.HasContent(Music)">
  <label>135</label>
  <icon>DefaultMusicGenres.png</icon>
  <content>artists</content>
  <group>genres</group>
</node>

As you can see we are using standard XML format here so nothing too complicated.

2.2 XML node components

Order = This is the order that you want to show the nodes. Starts at 1 for the top and goes sequentially so 2 will be the next node down.

Label = This is the text that will show for the node. In this case it is pointing to an ID in the strings.xml file (for translation purposes) It can also just be any String you want, just type some text instead of the id number.

Path = This can be any valid Kodi path, such as a file path. This includes internal Kodi DB paths, such as musicdb://recentlyaddedalbums. For more on internal paths, see Opening Windows and Dialogs.

Icon = Pretty self explanatory really, this is the icon that will show when the node is navigated over.

3 Manually creating or editing a custom node

So now we understand how the default nodes work, lets have a look at making a custom node. Custom nodes live inside your Userdata folder. To create custom nodes, the first step is to copy the whole of the default node file structure from the default library folder to a new folder called library inside your Userdata folder.

So, in the case of Windows, copy the 'music' folder from C:\Program Files (x86)\XBMC\system\library to %appdata%\XBMC\userdata\library.

Having copied the node structure, we can now create a new xml file under the relevant directory.

In a vanilla install with the confluence skin, custom nodes in /music will appear in the sub-list of the Music main menu item.

For now, we're going to place our node under

/userdata/library/music/

Let's call it Custom_Genre_Country.xml

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="10" type="filter">
 <label>(Custom) Genre Country</label>
 <content>artists</content>
  <match>all</match>
   <rule field="genre" operator="is">
       <value>Country</value>
   </rule>
</node>

As you can see as well as changing the order, we have a few more xml tags this time:

Type = Can be folder or filter, folder requires path to be set.

Match = Specifies how many rules should match. In this case we are matching all rules.

Rule = Any rule created with the smart playlist editor. (See Smart Playlists)

Limit = Limit the number of results returned (can be excluded altogether for unlimited)


Custom node in action

So there you have it, a simple genre filter for country music.

There are many other rules you can apply, a simple way to find them is to have a go with the smart playlist editor and copy the rule from the resulting xml playlist. There are many possibilities, you could create a rule for any of the database fields such as genre or year, use paths or combine rules together.

A more advanced idea would be a node structure so you could browse your albums by the first letter like this:

A more advanced custom node

4 See also

5 Notes

Personal tools
Namespaces

Variants
Actions
Navigation
Wiki help
Toolbox