Kodi Community Forum

Full Version: video playlist content checking
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am working on videoplaylist. The playlist is displayed using the same viewmodes / containers as the videolibrary. But videoplaylist can contain arbitrary mix of movies, musicvideos, and episodes. So Container.Content is null. To check ListItem content type, I am using the following infolabels as proxy:

musicvideo: !IsEmpty(ListItem.Artist)
episode: !IsEmpty(ListItem.Episode)
movie: IsEmpty(ListItem.Artist) + IsEmpty(ListItem(Episode)

An alternative is to use MusicPartyMode.Enabled, which implies content is musicvideo, but that is a special case.

These are used in variable condition statements where I select the desired infolabel to display.

This seems kind of kludgy. Is there a better way to do this?

scott s.
.
Quote:ListItem.DBType
Shows the database type of the ListItem.DBID for videos (movie, set, genre, actor, tvshow, season, episode). It does not return any value for the music library. Beware with season, the "*all seasons" entry does give a DBTYPE "season" and a DBID, but you can't get the details of that entry since it's a virtual entry in the Video Library.

And if you're using Krypton -

Quote:2015-12-31 Changed infolabel

ListItem.DBType now also works in the music library.
it will return 'artist', 'album' or 'song', depending on the listitem.

2200084 (post)
(2016-02-14, 11:20)Hitcher Wrote: [ -> ]
Quote:ListItem.DBType
Shows the database type of the ListItem.DBID for videos (movie, set, genre, actor, tvshow, season, episode). It does not return any value for the music library. Beware with season, the "*all seasons" entry does give a DBTYPE "season" and a DBID, but you can't get the details of that entry since it's a virtual entry in the Video Library.

And if you're using Krypton -

Quote:2015-12-31 Changed infolabel

ListItem.DBType now also works in the music library.
it will return 'artist', 'album' or 'song', depending on the listitem.

2200084 (post)

Perfect, thanks.
Unfortunately I came across another problem so have to use VideoPlayer which doesn't
have that DBType attribute. From testing it seems like Container.CurrentItem returns the index of the focused item, while Container.Position always returns 1 (at least in a fixedlist, though I wouldn't think that makes a difference). Container.ListItem(0) also is the focused item. I was hoping to get the index of the currently playing item in the list. It's not a problem in partymode as the playing item is always the first entry there.

scott s.
.
(2016-02-15, 01:48)scott967 Wrote: [ -> ]
(2016-02-14, 11:20)Hitcher Wrote: [ -> ]
Quote:ListItem.DBType
Shows the database type of the ListItem.DBID for videos (movie, set, genre, actor, tvshow, season, episode). It does not return any value for the music library. Beware with season, the "*all seasons" entry does give a DBTYPE "season" and a DBID, but you can't get the details of that entry since it's a virtual entry in the Video Library.

And if you're using Krypton -

Quote:2015-12-31 Changed infolabel

ListItem.DBType now also works in the music library.
it will return 'artist', 'album' or 'song', depending on the listitem.

2200084 (post)

Perfect, thanks.
Unfortunately I came across another problem so have to use VideoPlayer which doesn't
have that DBType attribute. From testing it seems like Container.CurrentItem returns the index of the focused item, while Container.Position always returns 1 (at least in a fixedlist, though I wouldn't think that makes a difference). Container.ListItem(0) also is the focused item. I was hoping to get the index of the currently playing item in the list. It's not a problem in partymode as the playing item is always the first entry there.

scott s.
.

Try Container.listitemabsolute
(2016-02-15, 07:02)phil65 Wrote: [ -> ]
(2016-02-15, 01:48)scott967 Wrote: [ -> ]
(2016-02-14, 11:20)Hitcher Wrote: [ -> ]And if you're using Krypton -


2200084 (post)

Perfect, thanks.
Unfortunately I came across another problem so have to use VideoPlayer which doesn't
have that DBType attribute. From testing it seems like Container.CurrentItem returns the index of the focused item, while Container.Position always returns 1 (at least in a fixedlist, though I wouldn't think that makes a difference). Container.ListItem(0) also is the focused item. I was hoping to get the index of the currently playing item in the list. It's not a problem in partymode as the playing item is always the first entry there.

scott s.
.

Try Container.listitemabsolute

What I wanted was the ListItem in the playlist that is currently playing (ListItem.IsPlaying). I thought that was what the "CurrentItem" was supposed to be pointing to. I've been looking at Container.CurrentItem and Container.Position in different contexts, and can't see the logic in how they are set.

scott s.
.