heads up: Video library reorganisation via XML

  Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
ronie Online
Team-Kodi Member
Posts: 9,445
Joined: Jan 2009
Reputation: 165
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 Kodi online-manual, FAQ and search the forum before posting.
Do not PM or e-mail Team-Kodi 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: 26,221
Joined: Oct 2003
Reputation: 178
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 Online
Donor
Posts: 3,838
Joined: Dec 2008
Reputation: 52
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:

Amber
Quartz

find quote
sho Offline
Team-XBMC Member
Posts: 4,128
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: 26,221
Joined: Oct 2003
Reputation: 178
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,128
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 Online
Donor
Posts: 3,838
Joined: Dec 2008
Reputation: 52
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:

Amber
Quartz

find quote
pecinko Online
Donor
Posts: 3,838
Joined: Dec 2008
Reputation: 52
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:

Amber
Quartz

(This post was last modified: 2012-05-02 14:55 by pecinko.)
find quote
sho Offline
Team-XBMC Member
Posts: 4,128
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
Senior Member
Posts: 103
Joined: Jan 2010
Reputation: 1
Post: #10
What should I do if I don't have the system/library/video or system/library/video_flat folder structure?
find quote
sho Offline
Team-XBMC Member
Posts: 4,128
Joined: May 2004
Reputation: 3
Post: #11
Ugrade to a build that has them

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
jmarshall Offline
Team-XBMC Developer
Posts: 26,221
Joined: Oct 2003
Reputation: 178
Post: #12
@pecinko:

Assuming your video files can be differentiated either by smartplaylists or (if not in the library) by different paths, then sure.

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 Online
Donor
Posts: 3,838
Joined: Dec 2008
Reputation: 52
Location: Prague / Belgrade
Post: #13
I've been thinking about this some more and although I might be digging my own hole considering skin re-coding that would need to take place, I wonder what do you think about taking this step further. Considering this major update to XBMC organization and work involved both in XBMC and skin code maybe we should make it more agnostic and get advanced users more involved in altering XBMC look and feel. I propose:

1) Index.xml (/userdata/database/index.xml) containing list of links for home page main navigation. This would be user customizable set of links for home page. Each item in this list would need to have an ID. Basically, it is what we have now - we have only moved <content>...</content> of main navigation list to index.xml

2) Instead of {video} and {video_flat} we place folders named after IDs from index.xml containing filters for that item. Given that "Movies" in index.xml have ID="1", our folder should be named "1". We put our filters there if we want them or just don't make folder "1" if we want to go directly to "Movies".

Ad 1: we reserve ID=9000 for main navigation on home page so that list of user created links in index.xml can be passed to it
Ad 2: we reserve ID=9001-9050 for main navigation sublist (filters) so we can pass defined filters (9001 sublist = filters item id=1 in container 9000)

This way maybe we don't need flatten/unflatten, we can use it for music and other XBMC sections as well as for videos and we can have customizable home screen as well.

Just as an example, I prefer grouping all my add ons under "Addons" menu and I have "home" menu on home screen, containing pictures and home videos.

For organizing links and filters, we could have a new screen similar to file browser. Not sure about drag and drop, as I really think mouse does not be log to XBMC, but we can have "move up" and "move down" as in favorites. BTW, people are already using favorites to assign custom links on home page, both main and filters so what I'm proposing above is not really new thing rather suggestion for doing it in official and more user friendly manner. Only thing you can not do through favorites ATM is assigning thumbs and fanart to your preferred links.

[Image: screenshot20120503at113.th.png] [Image: screenshot20120503at113.th.png]

My skins:

Amber
Quartz

find quote
jmarshall Offline
Team-XBMC Developer
Posts: 26,221
Joined: Oct 2003
Reputation: 178
Post: #14
flatten/unflatten is only there now because it was more important to get this in and have people start using it and seeing the possibilities.

It'll be gone once things are more easily customised, as 99.9% of the time users have it one way or the other. They don't want or need to be able to switch between 'em all the time.

So yes, that will be gone. How I see the homescreen working is that lists will be auto-filled, but the skinner must still have a small amount of control, thus the idea to simply fill listings using library://video/ style URIs. There's no reason why the scheme can't be extended to cover other areas of XBMC.

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
Hitcher Offline
Skilled Skinner
Posts: 11,077
Joined: Aug 2007
Reputation: 103
Location: Eastleigh, UK
Post: #15
So, in theory, you could have your entire movie collection listed on the home screen?
find quote
Post Reply