heads up: Video library reorganisation via XML

  Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
ronie Offline
Team-XBMC Member
Posts: 8,259
Joined: Jan 2009
Reputation: 108
Post: #1
this one doesn't require any skin changes,
though still something skinners should be aware of imo.

commit: https://github.com/xbmc/xbmc/commit/6910...37ec155f9c

the video library is now fully customizable.
the user can add / remove any library nodes to their own liking.


see PR 903 for some background info.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not PM or e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 24,523
Joined: Oct 2003
Reputation: 138
Post: #2
Next step will be incorporating a reasonable way to incorporate this a little nicer into skins. I think XBMC filling "static" content containers based on the library paths may be the way forward?

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
pecinko Offline
Member+
Posts: 3,019
Joined: Dec 2008
Reputation: 27
Location: Prague / Belgrade
Post: #3
A couple of questions, if I may

1) How does this work (using OS X nightly 2012 05 02)

2) What is the general plan behind this? Would be nice to know so I can think about skin code and avoid unnecessary rewrites.

My skins:

Quartz
Amber
find quote
sho Offline
Team-XBMC Member
Posts: 4,133
Joined: May 2004
Reputation: 3
Post: #4
Preliminary documentation:

This allows you to customize the video library nodes as you see fit. 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. Hate the library? Hide it.

The standard library layout can be found under system/library
video - simulating the old unflattened library structure
video_flat - simulating the old flattened library structure

To get your custom library nodes going, simply copy the existing structure to /userdata/Database and modify to your heart's desire. (Note that there is no library folder there, only video and video_flat), so
'/userdata/Database/video' and/or '/userdata/Database/video_flat'

Also note that if you only want to modify the flattened structure, only video_flat needs to be created. (and vice versa).
There are two basic types of nodes that can be created, virtual folders and normal nodes.
Let's begin with virtual folders.
You start out by creating a subfolder that must contain an index.xml. It shares node characteristics that are explained below but must at minimum contain a node and label tag.
Inside this virtual folder you can dump as many regular nodes as you see fit, which are explained below

In essence a library node is simply a smart playlist with a twist.
If you explore the existing ones you will see that they differ, but at the same time they share a lot of common attributes.

Going though the tags, one at a time:

<node order="2" type="filter" visible="Library.HasContent(Movies)">
node tag, may contain order (the ordering of items in the structure) type (valid options "folder" or "filter") and HasContent similar to skins. Valid content can be found here:
http://wiki.xbmc.org/index.php?title=Lis...onditions.
<label>, this can point to an ID in the strings.xml file (for translation) or include any name you want.
<icon> you can have the node have any icon found in the skin
https://github.com/xbmc/xbmc/tree/master...ence/media
Then come the juice parts, I will not claim to be an expert here, but I will do my best and from this just about anything currently possible in XBMC should be deducible.
<content> any valid content (movies, episodes etc)
<match> How many of the rules should match? (one, all)
<limit> Limits the number of returned results
<path> can be an actual path? At least any XBMC special: path such as videodb://1/2 and sources://video
<rule> just lift this from an actual smart playlist to get any filtering XBMC is currently capable of, such as:
<rule field="path" operator="doesnotcontain">C:\Media\Mediatst\Kidstest\</rule>
<rule field="genre" operator="is">Animation</rule>

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
(This post was last modified: 2012-05-03 13:05 by sho.)
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 24,523
Joined: Oct 2003
Reputation: 138
Post: #5
There's a few minor issues to iron out, mostly relating to how sets are handled - with a general "group sets in everything" it doesn't really work that well for things like recently added when sets are all grouped together. Not sure the best way to handle as yet.

But basically, just take a nosy through system/library/video(_flat)

XML files describe the layout. There's 3 types of "nodes":

1. Virtual folders. These are real folders in the above folder heirarchy, described using index.xml inside the folder. These are for general heirarchy building. The movies/tvshow/musicvideo overview nodes are examples.
2. Links to real folders. These act as shortcuts to real folders, which is anything the VFS knows about (i.e. videodb:// paths or actual paths on disk, or the playlists node, addons node, files node etc.) Requirement is to set the <path> tag inside these. Examples are all the nodes in the current structure.
3. Filters. These are identical to smartplaylists but are laid out slightly differently. Basically just change the <smartplaylist> bit to <node type="filter"> and add <label> and <icon> tags as needed. Example here: https://github.com/jmarshallnz/xbmc/blob...movies.xml

Note that you can copy the structure into userdata/Database/ and mess around there to your hearts content.

As for where to from here, well there's several things to look to:

1. Can we allow editing this from the UI (IMO this would be messy to do nicely, though with touch in the picture it becomes doable with a whole heap of background work to do first such as drag n drop).

2. The current homepage links don't really make sense if the user can alter the library structure. They'll still work, but one presumes that if the user wants to turn off a particular node, they also don't want a shortcut to it elsewhere. Potential ideas are allowing static lists to be filled using a directory which would allow you to just add submenus that consist of what the library structure is.

3. Gotta do the music lib as well (get rid of music files etc.)

4. I want to move the add source stuff to settings rather than relying on context/files node. This isn't necessarily easy given the current code for gui settings.

Cheers,
Jonathan

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
sho Offline
Team-XBMC Member
Posts: 4,133
Joined: May 2004
Reputation: 3
Post: #6
(2012-05-02 12:57)jmarshall Wrote:  2. The current homepage links don't really make sense if the user can alter the library structure. They'll still work, but one presumes that if the user wants to turn off a particular node, they also don't want a shortcut to it elsewhere. Potential ideas are allowing static lists to be filled using a directory which would allow you to just add submenus that consist of what the library structure is.
Maybe they could be made to behave like the links that can be made to Add-ons on home?
Then you would be able to select links to n xml files or nodes and order them in the same manner as we do for add-ons.
The question then would be, should we allow xml files from anywhere? (Yeah probably), not necessarily just from the active library structure.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
pecinko Offline
Member+
Posts: 3,019
Joined: Dec 2008
Reputation: 27
Location: Prague / Belgrade
Post: #7
Thanks both of you for explanations, got it workingSmile

(2012-05-02 12:57)jmarshall Wrote:  2. The current homepage links don't really make sense if the user can alter the library structure. They'll still work, but one presumes that if the user wants to turn off a particular node, they also don't want a shortcut to it elsewhere. Potential ideas are allowing static lists to be filled using a directory which would allow you to just add submenus that consist of what the library structure is.

Container with reserved ID (say id=9000] could be used in home window. That way container 9000 items (directory listing) could be dynamically filled by XBMC [Videos, Movies, TVShows, Music...]

My skins:

Quartz
Amber
find quote
pecinko Offline
Member+
Posts: 3,019
Joined: Dec 2008
Reputation: 27
Location: Prague / Belgrade
Post: #8
Some more questions:

1) Can we have fanart tag in addition to icon for xmls?

2) Is there a way to make this

[Videos]
- all videos
- vacation Greece
- skiing videos
/nothing else/

[Movies]
-all movies
-unwatched
-recently added
-genres

[Addons]
- video addons

With flattening ON, filters should be skipped and Videos should take me to All videos while Movies should take me to All movies.

This way I could have Movies with filters for adults, flattened Movies for kids, home Videos for everyone and Video Add-ons hidden from kids.

3) Is there a plan/way to get XBMC to serve filters to home page as well? Without this Quartz home page is rendered hmmm.. useless as you have category labels (non-clickable) with filters list below.

My skins:

Quartz
Amber
(This post was last modified: 2012-05-02 14:55 by pecinko.)
find quote
sho Offline
Team-XBMC Member
Posts: 4,133
Joined: May 2004
Reputation: 3
Post: #9
(2012-05-02 14:54)pecinko Wrote:  2) Is there a way to make this

As one playlist or 3 different? (one does not really make sense so I assume 3)

[Videos]
- all videos - Might be tough, since there is no type for all videos.
- vacation Greece - based on path (contains) or custom genre, sure
- skiing videos - ditto
/nothing else/

[Movies]
-unwatched would be a rule of watch count = 0 (create a smart playlist for exact syntax)
The rest has examples in the existing structure or documentation above.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
(This post was last modified: 2012-05-02 15:13 by sho.)
find quote
brando56894 Offline
Member
Posts: 93
Joined: Jan 2010
Reputation: 0
Post: #10
What should I do if I don't have the system/library/video or system/library/video_flat folder structure?
find quote
Post Reply