Kodi Community Forum

Full Version: Position in a list?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Sorry for being dense - I feel this must have been mentioned countless times before. What's the infolabel for an item's position in a list container?
Not sure we're on the same page here. I meant the equivalent of a track number but for a playlist, so I can have the 'playlist track numbers' alongside the list items.
Container.ListItem.TrackNumber gets you the actual album track number. Is that what you're after or just the position in the list, i.e., 1, 2, 3, 4...
Just the position in the list.
Good question. I'm stumped.
code:
Container(id).CurrentItem
Current item in the container or grouplist with given id. If no id is specified it grabs the current container.
Guess I'm not really explaining properly. I'm not trying to retrieve information about the item at position x, I'm trying to put the track number next to every item in the list. Obviously I could use ListItem.TrackNumber for this, but that'll just give me the track number from each item's ID3 tag, which makes no sense in the context of a playlist.
we don't have a ListItem.* infolabel that returns such info afaik.
$INFO[MusicPlayer.Offset(#).PlaylistPosition]

Playlist starts at 0....

I use this for 3 title label on osd

xml:
<value condition="Player.HasAudio + !Window.IsActive(MusicOSD) + MusicPlayer.HasNext">[COLOR=$INFO[Skin.String(OSDSecondaryTextColor)]]$LOCALIZE[19031] • [/COLOR]$INFO[MusicPlayer.Offset(1).Artist] - $INFO[MusicPlayer.Offset(1).Title] • [COLOR=$INFO[Skin.String(OSDSecondaryTextColor)]]$LOCALIZE[554]:[/COLOR] $INFO[MusicPlayer.Offset(1).PlaylistPosition][COLOR=$INFO[Skin.String(OSDSecondaryTextColor)]]/[/COLOR]$INFO[MusicPlayer.PlaylistLength][CR]$INFO[MusicPlayer.Offset(2).Artist] - $INFO[MusicPlayer.Offset(2).Title] • [COLOR=$INFO[Skin.String(OSDSecondaryTextColor)]]$LOCALIZE[554]:[/COLOR] $INFO[MusicPlayer.Offset(2).PlaylistPosition][COLOR=$INFO[Skin.String(OSDSecondaryTextColor)]]/[/COLOR]$INFO[MusicPlayer.PlaylistLength][CR]$INFO[MusicPlayer.Offset(3).Artist] - $INFO[MusicPlayer.Offset(3).Title] • [COLOR=$INFO[Skin.String(OSDSecondaryTextColor)]]$LOCALIZE[554]:[/COLOR] $INFO[MusicPlayer.Offset(3).PlaylistPosition][COLOR=$INFO[Skin.String(OSDSecondaryTextColor)]]/[/COLOR]$INFO[MusicPlayer.PlaylistLength]</value>

Unsure if i'll work with List.item
Quote:https://kodi.wiki/view/InfoLabels#Playlist
9 Playlist
InfoLabels Definition Version
Playlist.Length(media) Total size of the current playlist. optional parameter media is either video or music.
Playlist.Position(media) Position of the current item in the current playlist. optional parameter media is either video or music.
Playlist.Random Returns string ID's 590 (Randomize Play Enabled) or 591 (Disabled)
Playlist.Repeat Return