video playlist content checking
#1
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.
.
Reply
#2
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.

http://forum.kodi.tv/showthread.php?tid=...pid2200084
Reply
#3
(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.

http://forum.kodi.tv/showthread.php?tid=...pid2200084

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.
.
Reply
#4
(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.

http://forum.kodi.tv/showthread.php?tid=...pid2200084

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
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#5
(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 -


http://forum.kodi.tv/showthread.php?tid=...pid2200084

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

Logout Mark Read Team Forum Stats Members Help
video playlist content checking0