Video nodes: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
m (Bot: Automated text replacement (-class="wikitable" +class="prettytable" & -Available Tags +Available tags & -<source +<syntaxhighlight & -</source> +</syntaxhighlight>))
 
(29 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{mininav|[[General topics]]|[[Videos]]|[[Video library/Navigation|Navigation]] {{l2|[[Video library/Management|Management]]}}}}
{{mininav|[[Video library]]|[[Video management|Management]] }}
<section begin="intro" />Video nodes are defined views that are used to organize your media from the videos menu. In the past XBMC has had a number of standard nodes such as Title, Director, Year, Studios, Countries, Genres that were hard coded. As of v12 Frodo, XBMC introduces the ability to customize these nodes using an XML file. Using XML files really gives great flexibility in how you display your media. Don't want your screaming kids stuff in your main movie node... exclude it. Want documentaries in a separate node, create it. Don't like how recently added is presented, change it.
<section begin="intro" />Video nodes are defined views that are used to organize your media from the videos menu. ''Title, Director, Year, Studios, Countries, Genres'' are examples of Nodes. These Nodes can be customised using an XML file which gives flexibility in how you display your media. Custom nodes will work with any skin, but for ease of use a compatible skin is preferred.<section end="intro" />


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.<section end="intro" />
== Library node editor add-on ==
{{main|Add-on:Library Node Editor}}
Users can now create and edit video and music nodes from within {{kodi}} thanks to the community add-on [[Add-on:Library Node Editor|Lbrary Node Editor]].


== The default Nodes ==
== Technical documentation ==
[[File:defaultnodes.jpg|right|500px|frame|The standard XBMC video nodes]]
 
XBMC ships with default nodes that are located in the XBMC main filesystem:
=== Default video nodes ===
[[File:defaultnodes.jpg|right|500px|frame|The standard video 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:


{| border="1" cellpadding="4" class="prettytable"
{| border="1" cellpadding="4" class="prettytable"
Line 12: Line 18:
! '''default nodes paths'''
! '''default nodes paths'''
|-
|-
|'''Android''' || ?
|'''Android''' || /data/data/org.xbmc.kodi/cache/apk/assets/system/library/
|-
|-
|'''iOS''' - Varied || /Applications/XBMC.frappliance/XBMCData/XBMCHome/system/library/ <br /> /Applications/XBMC.app/XBMCData/XBMCHome/system/library/
|'''iOS''' - Varied || /Applications/Kodi.frappliance/KodiData/KodiHome/system/library/ <br /> /Applications/Kodi.app/KodiData/KodiHome/system/library/
|-
|-
|'''Linux''' || /usr/share/xbmc/system/library/
|'''Linux''' || /usr/share/Kodi/system/library/
|-
|-
|'''Mac OS X''' || /Applications/XBMC.app/Contents/Resources/XBMC/system/library/
|'''Mac OS X''' || /Applications/Kodi.app/Contents/Resources/Kodi/system/library/
|-
|-
|'''Windows (32bit)''' || C:\Program Files\XBMC\system\library\
|'''Windows (32bit)''' || C:\Program Files\Kodi\system\library\
|-
|-
|'''Windows (64bit)''' || C:\Program Files (x86)\XBMC\system\library\
|'''Windows (64bit)''' || C:\Program Files (x86)\Kodi\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 ''video/movies/years.xml'' node in its simplest form:
To understand nodes a little better, lets take a look at one of the defaults. As an example take a quick look at the ''video/movies/years.xml'' node in its simplest form:


<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<syntaxhighlight lang="XML" enclose="div">
<node order="3" type="folder">
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="3" type="filter">
   <label>562</label>
   <label>562</label>
  <path>videodb://1/3</path>
   <icon>DefaultYear.png</icon>
   <icon>DefaultYear.png</icon>
</node>
  <content>movies</content>
  <group>years</group>
</node>
</syntaxhighlight>


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


== XML node components ==
=== 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.
'''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 transltion purposes) It can also just be any String you want, just type some text instead of the id number.
'''Label''' = This is the text that will show for the node. In this case it is pointing to an ID in the strings.po file (for transltion 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 XBMC path (see example below, doesn't have to be an existing path i.e. videodb://1/1/1 is a valid path) <br/> NOTE: For an explanation of what "''<path>videodb://1/3</path>''" means, along with similar statements, see [[Opening Windows and Dialogs]].
'''Path''' = This can be any valid Kodi path, such as a file path. This includes internal Kodi DB paths, such as <code>videodb://movies/genres/</code>. 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.
'''Icon''' = Pretty self explanatory really, this is the icon that will show when the node is navigated over.


== Creating a Custom node ==
== 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 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 'video' and the 'video_flat' folders from ''C:\Program Files (x86)\XBMC\system\library'' to ''%appdata%\XBMC\userdata\library''.
So, in the case of Windows, copy the 'video' and the 'video_flat' folders from ''C:\Program Files (x86)\Kodi\system\library'' to ''%appdata%\Kodi\userdata\library''.


Why the whole lot? Well, currently it seems that when you have a custom video node in your userdata folder, it's assumed that you are customizing the node structure, and that therefore any nodes that are missing are missing intentionally.
Why the whole lot? Well, currently it seems that when you have a custom video node in your userdata folder, it's assumed that you are customizing the node structure, and that therefore any nodes that are missing are missing intentionally.
Line 56: Line 65:
In a vanilla install with the confluence skin, custom nodes in ''/video'' will appear in the sub-list of the Video main menu item.  
In a vanilla install with the confluence skin, custom nodes in ''/video'' will appear in the sub-list of the Video main menu item.  


Custom nodes in the ''/video/movies'' will appear in the sub-list of 'Movies' which in turn appears in the sub-list of Video. NOTE: it will not appear in the sub-list of 'Movies' as, in the confluence skin at least, this is set to list all the video source content marked as 'movies'.
Custom nodes in the ''/video/movies'' will appear in the sub-list of 'Movies' which in turn appears in the sub-list of Video.


In other skins (notably, Aeon Nox), custom main-menu items can be set to a custom video node, meaning that you can use your custom video nodes to have a main-menu item for your collection of post-modern european arthouse anime, if you so wish.
In other skins (notably, Aeon Nox), custom main-menu items can be set to a custom video node, meaning that you can use your custom video nodes to have a main-menu item for your collection of post-modern european arthouse anime, if you so wish.
Line 69: Line 78:
  <node order="10" type="filter">
  <node order="10" type="filter">
   <label>(Custom) Motor DVDs</label>
   <label>(Custom) Motor DVDs</label>
  <path>videodb://1/1/1</path>
   <content>movies</content>
   <content>movies</content>
   <match>all</match>
   <match>all</match>
   <icon>DefaultCars.png</icon>
   <icon>DefaultCars.png</icon>
   <limit>20</limit>
   <limit>20</limit>
   <rule field="path" operator="contains">//nas1/Videos/ExtremeSports/Cars</rule>
   <rule field="path" operator="contains"><value>ExtremeSports/Cars/</value></rule>
  </node>
  </node>


Line 83: Line 91:
'''Match''' = Specifies how many rules should match. In this case we are matching all rules.
'''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]])
'''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)
'''Limit''' = Limit the number of results returned (can be excluded altogether for unlimited)
Line 97: Line 105:
  <node order="2" type="filter">
  <node order="2" type="filter">
   <label>Movies</label>
   <label>Movies</label>
  <path>videodb://1/2</path>
   <content>movies</content>
   <content>movies</content>
   <icon>DefaultMovieTitle.png</icon>
   <icon>DefaultMovieTitle.png</icon>
   <match>all</match>
   <match>all</match>
   <rule field="path" operator="doesnotcontain">//NAS1/Videos/ExtremeSports/Cars/</rule>
   <rule field="path" operator="doesnotcontain"><value>/ExtremeSports/Cars/</value></rule>
  </node>
  </node>


Line 108: Line 115:
[[File:customnodes.jpg|500px|Various custom video nodes]]
[[File:customnodes.jpg|500px|Various custom video nodes]]


== Creating a Custom parent node ==
== Manually creating or editing a custom parent node ==
You can also create a nested node structure as can be observed in the "unflattened" default structure from [[Custom video nodes#The default Node|above]] (under video).
You can also create a nested node structure as can be observed in the "unflattened" default structure from [[Video_nodes|above]] (under video).
Then you simply create a folder containing valid xml node files and also include a "index.xml" file that looks like this (which of course can be adapted to the type of media required):
Then you simply create a folder containing valid xml node files and also include a "index.xml" file that looks like this (which of course can be adapted to the type of media required):


Line 118: Line 125:
   <icon>DefaultMovies.png</icon>
   <icon>DefaultMovies.png</icon>
  </node>
  </node>
== Examples ==
[[File:PatK_Nodes.jpg|500px]]


== See also ==
== See also ==
* [[Music_nodes| Music nodes]]
* [[Custom home items]]
* [[Custom home items]]
* [[Smart playlists]]
* [[Video library tags]]
== Notes ==
{{Updated|16}}


[[Category:Video Library]]
[[Category:Video library]]
[[Category:XBMC Manual]]
[[Category:Manual]]
{{Frodo updated}}

Latest revision as of 00:53, 14 April 2022

Home icon grey.png   ▶ Video library ▶ Management ▶ Video nodes

Video nodes are defined views that are used to organize your media from the videos menu. Title, Director, Year, Studios, Countries, Genres are examples of Nodes. These Nodes can be customised using an XML file which gives flexibility in how you display your media. Custom nodes will work with any skin, but for ease of use a compatible skin is preferred.

Library node editor add-on

Users can now create and edit video and music nodes from within Kodi thanks to the community add-on Lbrary Node Editor.

Technical documentation

Default video nodes

The standard video 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 /data/data/org.xbmc.kodi/cache/apk/assets/system/library/
iOS - Varied /Applications/Kodi.frappliance/KodiData/KodiHome/system/library/
/Applications/Kodi.app/KodiData/KodiHome/system/library/
Linux /usr/share/Kodi/system/library/
Mac OS X /Applications/Kodi.app/Contents/Resources/Kodi/system/library/
Windows (32bit) C:\Program Files\Kodi\system\library\
Windows (64bit) C:\Program Files (x86)\Kodi\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 video/movies/years.xml node in its simplest form:

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

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

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.po file (for transltion 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 videodb://movies/genres/. 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.

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 'video' and the 'video_flat' folders from C:\Program Files (x86)\Kodi\system\library to %appdata%\Kodi\userdata\library.

Why the whole lot? Well, currently it seems that when you have a custom video node in your userdata folder, it's assumed that you are customizing the node structure, and that therefore any nodes that are missing are missing intentionally.

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 /video will appear in the sub-list of the Video main menu item.

Custom nodes in the /video/movies will appear in the sub-list of 'Movies' which in turn appears in the sub-list of Video.

In other skins (notably, Aeon Nox), custom main-menu items can be set to a custom video node, meaning that you can use your custom video nodes to have a main-menu item for your collection of post-modern european arthouse anime, if you so wish.

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

/userdata/library/video/

Let's call it Custom_Motor_dvds.xml

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="10" type="filter">
 <label>(Custom) Motor DVDs</label>
 <content>movies</content>
 <match>all</match>
 <icon>DefaultCars.png</icon>
 <limit>20</limit>
 <rule field="path" operator="contains"><value>ExtremeSports/Cars/</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 path filter for our Motor DVDs.

One thing that you may want to do now is edit your "Title" xml file to remove the motor dvds from the main movie library. Though if you are attempting to setup a main movie entrypoint for a path labeled "Movies" it may be best to simply hide the default Movies entry from the main menu and create a "Custom Movies" video node that points to your specific path. Still you can remove paths using the DoesNotContain operator:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="2" type="filter">
 <label>Movies</label>
 <content>movies</content>
 <icon>DefaultMovieTitle.png</icon>
 <match>all</match>
 <rule field="path" operator="doesnotcontain"><value>/ExtremeSports/Cars/</value></rule>
</node>

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.

Various custom video nodes

Manually creating or editing a custom parent node

You can also create a nested node structure as can be observed in the "unflattened" default structure from above (under video). Then you simply create a folder containing valid xml node files and also include a "index.xml" file that looks like this (which of course can be adapted to the type of media required):

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="1" visible="Library.HasContent(Movies)">
  <label>342</label>
  <icon>DefaultMovies.png</icon>
</node>

Examples

PatK Nodes.jpg

See also

Notes