IDEA: Better Container.Content/Foldername

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
jmarshall Offline
Team-XBMC Developer
Posts: 25,700
Joined: Oct 2003
Reputation: 169
Post: #1
Hi all,

For some time we've known that the existing ways of choosing views based on container.content is a little flawed, particularly when it comes to addons.

So here's a thread to get to the bottom of the issue, and get it fixed in time for Eden.

Essentially I want to remove the need for skins to have to look at container.folderpath or listitem.path in order to determine what they should display - it should all be done in a consistent manner instead.

Related ticket for Container.FolderName: http://trac.xbmc.org/ticket/10313

So, first up we can improve Container.Content so that what we set there better aligns with the things you want. A couple of ideas here:

1. First up we'll need a good list of what we currently have, and what they mean.
2. Then we can extend it to a better list as needed.
3. Perhaps we could have extended attributes of the list.
- we could indicate that it's an addon listing the addon supplies movies
- alternatively we could indicate how much metadata we expect the list to provide (for those addons that have thumbs but not much extra metadata).
- We could possibly also specify the sort of thumb that the list generally applies.

Let me know your thoughts and let's get it fixed.

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]
(This post was last modified: 2011-02-20 00:46 by jmarshall.)
find quote
ronie Offline
Team-XBMC Member
Posts: 8,988
Joined: Jan 2009
Reputation: 147
Post: #2
i for one, and i'm sure many others, use the various container and listitem paths to display images not natively supported by xbmc
(think: cdart, clearart, extrafanart, tvshow logo, genre icons...and what not).

since files will soon be moved to the library, i would be nice to have some Container.Content() definition
for uncategorized (content set to 'none') videos.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not PM or e-mail Team-XBMC 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: 25,700
Joined: Oct 2003
Reputation: 169
Post: #3
There is "files" I think already?

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
jmarshall Offline
Team-XBMC Developer
Posts: 25,700
Joined: Oct 2003
Reputation: 169
Post: #4
A friendly bump. I know there's a lot of use of ListItem.Path so let's try and get rid of it via a better system Smile

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
ronie Offline
Team-XBMC Member
Posts: 8,988
Joined: Jan 2009
Reputation: 147
Post: #5
how about extending Container.Content() to this list:
http://wiki.xbmc.org/index.php?title=Ope...nd_Dialogs

currently i have to use substring(Container.FolderPath,videodb://3/1/) to detect if a user is browsing movie genres or music-video genres, as i use a different set of genre icons for both.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not PM or e-mail Team-XBMC members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
mcborzu Offline
Skilled Skinner
Posts: 3,381
Joined: Feb 2009
Reputation: 15
Location: dsf
Post: #6
I have to use:

substring(listitem.path,special://profile/playlists/video) | substring(listitem.path,newsmartplaylist)

To show "Video Playlists" in my breadcrumbs section

[Image: widget]

Check out The Carmichael - A Skin For XBMC

Check out Night - A Skin For XBMC

Check out Unfinished - A Skin For XBMC
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 25,700
Joined: Oct 2003
Reputation: 169
Post: #7
@ronie: Having too many (which that list certainly is) makes it more difficult for those that don't want to have separate things for musicvideo and movie genres. I'm interested in why you have separate icons and whether there's another way that could be done, as genre icon packs were also referenced in the skinart thread. Perhaps you could detail your reasoning, and how you setup the icon etc. over in that thread?

One idea to combat this is to split container.content up - the content is genres in both cases. But the context is musicvideos or movies. Supplying that information independently may be the way forward?

@mcborzu: so Container.FolderName need to have "Video Playlists" added?

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
mcborzu Offline
Skilled Skinner
Posts: 3,381
Joined: Feb 2009
Reputation: 15
Location: dsf
Post: #8
jmarshall Wrote:@ronie: Having too many (which that list certainly is) makes it more difficult for those that don't want to have separate things for musicvideo and movie genres. I'm interested in why you have separate icons and whether there's another way that could be done, as genre icon packs were also referenced in the skinart thread. Perhaps you could detail your reasoning, and how you setup the icon etc. over in that thread?

One idea to combat this is to split container.content up - the content is genres in both cases. But the context is musicvideos or movies. Supplying that information independently may be the way forward?

@mcborzu: so Container.FolderName need to have "Video Playlists" added?

Cheers,
Jonathan

Could be and maybe the same for Music Playlists? I was just going thru my code for examples where I use path to match something that could be built into Container.FolderName.

Seems like JezzX got most of the examples in the notes on Trac, as alot of the times we use these path tricks, other than pulling non-XBMC images, is for breadcrumbs...

[Image: widget]

Check out The Carmichael - A Skin For XBMC

Check out Night - A Skin For XBMC

Check out Unfinished - A Skin For XBMC
find quote
ronie Offline
Team-XBMC Member
Posts: 8,988
Joined: Jan 2009
Reputation: 147
Post: #9
jmarshall Wrote:@ronie: Having too many (which that list certainly is) makes it more difficult for those that don't want to have separate things for musicvideo and movie genres.

well they're all different nodes, so iit would make some sense if were able to code different layouts for them. i believe it would be very flexible and that's what us skinners are looking for :-)

if the list would be implemented it should in addition (not as a replacement) to what we already have.

so depending on want you want, you could either use
  • Container.Content(Genres) (returns true for all contents)
  • Container.Content(MovieGenres) (return true for movies only)

furthermore a way to figure out if we are at root level:
  • Container.Content(VideoRoot)
  • Container.Content(MoviesRoot)

and things that would cover an enitire section:
  • Container.Content(VideoLibrary) - returns true everywhere
  • Container.Content(MoviesLibrary) - returns true everywhere in the movie library

jmarshall Wrote:I'm interested in why you have separate icons and whether there's another way that could be done, as genre icon packs were also referenced in the skinart thread. Perhaps you could detail your reasoning, and how you setup the icon etc. over in that thread?

i don't have any reggae movies, nor do i have any adventure musicvideos in my collection. so different content needs a different genre pack.
technically, there's no reason why the two can't be merged in one pack though...

just think of it as studio logos vs. record label logos.
the first are used for movies/episodes, the second for songs/musicvideos.

jmarshall Wrote:One idea to combat this is to split container.content up - the content is genres in both cases. But the context is musicvideos or movies. Supplying that information independently may be the way forward?

'fraid it's not clear to me how that would be different from a skinners point of view?

use Container.Content(Genres,Movies) instead of Container.Content(MovieGenres)...?

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not PM or e-mail Team-XBMC 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: 25,700
Joined: Oct 2003
Reputation: 169
Post: #10
Quote:use Container.Content(Genres,Movies) instead of Container.Content(MovieGenres)...?

Basically, yes. Essentially I want to do exactly as you elucidate, only in a more obvious way how the various states apply - essentially Container.Content(Genres) + Container.Content(Movies) seems better to me than Container.Content(MovieGenres) but maybe it's the programmer speaking - obvious advantage is it reduces the number of permutations that need documenting.

Essentially I'd replace the single value content that we store with a vector of values that contain each of the values that apply to your current listing. I think what we'd need is:

Videos (so you know what window you're in)
Overview (this is the root view for now, but may change later as we allow other virtual folders)
Movies
MusicVideos
TvShows
Episodes
Playlists
Addons

Genres
Titles
Years
Actors
Directors
Studios
Sets
Countries
Seasons
Artists

I don't think we need things specific for recently added or other smartplaylists as they're essentially show, episode, musicvideo or movie title listings, right?

In addition, some knowledge of whether you just have files or folders will be useful to you perhaps? eg if the only thing in a folder is subfolders (or say 90% of the content is folders) then I could set "Folders" instead of "Files" or "Mixed" or something.

What about dealing with things like future search nodes, where we have mixed content?

Anything else that I'm missing?

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
Hitcher Offline
Skilled Skinner
Posts: 10,289
Joined: Aug 2007
Reputation: 80
Location: Eastleigh, UK
Post: #11
As discussed previously -

Container.AddonName to return the current Addon's name as defined in the addon.xml.
find quote
pecinko Offline
Donor
Posts: 3,677
Joined: Dec 2008
Reputation: 49
Location: Prague / Belgrade
Post: #12
I would like to suggest considering different usage of label2, based on Button id="3" (sorting) in Movies.

- Sort by name - no label2 shown
- Sort by runtime - label2 shows shorter time (as with listitem.duration) or at least time without seconds
- Sort by times played - don't show zeroes

My skins:

Amber
Quartz

find quote
jmarshall Offline
Team-XBMC Developer
Posts: 25,700
Joined: Oct 2003
Reputation: 169
Post: #13
@pecinko: Good suggestions (though I don't see why sort by name should erase label2), please open a separate thread for this.

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
ronie Offline
Team-XBMC Member
Posts: 8,988
Joined: Jan 2009
Reputation: 147
Post: #14
jmarshall Wrote:There is "files" I think already?

i've only just got around to test it...

Container.Content(Files) did indeed work on builds before the files_in_lib merge, but it's broken on anything after.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not PM or e-mail Team-XBMC 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: 25,700
Joined: Oct 2003
Reputation: 169
Post: #15
Where do you think "files" should apply?

ATM we set it to empty everywhere in the files node that does not have content set.

I'm not sure what advantage setting it to "files" has, unless you're using it elsewhere as well?

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
Post Reply