Heads-up: How to deal with content types / media types
#1
We missed some proper documentation about how to deal with content types properly, so here is a quick write-up how skinners should deal with adjusting the views for all the different types of content Kodi is supporting.

Kodi (core as well as plugins) assigns content types to both the complete containers and also to each individual listitem so that skinners can show appropriate views and metadata for each occasion. Often these two basically go hand-in-hand (like "movies" for container content and "movie" for listitem dbtype), but there are also exceptions to the rule. (examples: playlists with mixed content, or movies which are linked to tvshows) It is important to know about this and when to choose what for visible conditions for example.


For a start, here is a list of all available content types including some remarks and where you need to deal with them (in brackets)

Quote:"" (empty) - used for "categories" / "nodes", like our library root. (all mediawindows)
tags (videos and music)
years (videos and music)
genres (videos and music)
countries (videos and music)
studios (videos and music)
playlists (videos and music)
movies (videos) - general guideline: this one is used for everything which can be found on sites like themoviedb.com.
sets (videos)
tvshows (videos) - general guideline: this one is used for everything which can be found on sites like thetvdb.com
seasons (videos)
artists (videos and music) - used for both albums and musicvideos
albums (videos and music) - same
songs (music)
musicvideos (videos and music)
addons (addonbrowser, videos, music, pictures, programs)
actors (videos)
directors (videos)
files (videos, music) - used for library nodes with no content set
mixed (videos, music) - for mixed song/musicvideo playlists
images (pictures)
games (games) - since v18
unknown (videos) - set by uPnP sources
events (eventlog)
videos (videos) - this one here is for all videos which do not apply to the more specific mentioned ones like "movies", "episodes" etc. A good example are youtube videos. This one wasnt well-communicated up to now so please add this to viewtypes which are appropriate.


And here is a list with all available dbtypes for listitems:

Quote:artist
album
song
video
set
musicvideo
movie
tvshow
season
episode
music (not really used (yet), so can be ignored for now I think.)

Where should I use what?
Container.Content(xx) should be used for the selection of available viewtypes in general. So main use case is to use this for the visible condition of all your viewtype containers as well as for the item/focusedlayouts of these containers. For "furniture" (=stuff outside of the containers, like InfoPanels with metadata), it is better to use String.IsEqual(ListItem.DBType,xx) in most cases.
In your InfoDialog xmls you shouldnt use Container.Content(xx) at all, please use String.IsEqual(ListItem.Dbtype,xxx) there exclusively. InfoDialog layout should only be dependent on the listitem type, not on anything container-related.

In general it might be a good idea to start a skin with some very basic list which is allowed for every content type (=no visible conditions). When having that done, add specialised viewtypes for specific content types as you deem necessary.

It would be cool if skins from v16 on could deal with content types / dbtypes as described, so some backporting would be nice.

If you have further questions concerning this topic, feel free to ask. I hope this clears up some confusion because we are not the best when it comes to documentation in this area. Ideas / pointing out errors are also welcome, this is really just written down from out of my head.
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply


Messages In This Thread
Heads-up: How to deal with content types / media types - by phil65 - 2016-12-05, 22:35
Logout Mark Read Team Forum Stats Members Help
Heads-up: How to deal with content types / media types1