Kodi Community Forum
Position in a list? - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12)
+--- Thread: Position in a list? (/showthread.php?tid=335017)



Position in a list? - djh_ - 2018-08-29

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?


RE: Position in a list? - nonJon - 2018-08-29

Container(id).Position(pos)


RE: Position in a list? - djh_ - 2018-08-29

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.


RE: Position in a list? - nonJon - 2018-08-29

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


RE: Position in a list? - djh_ - 2018-08-29

Just the position in the list.


RE: Position in a list? - nonJon - 2018-08-29

Good question. I'm stumped.


RE: Position in a list? - Hitcher - 2018-08-29

code:
Container(id).CurrentItem
Current item in the container or grouplist with given id. If no id is specified it grabs the current container.



RE: Position in a list? - djh_ - 2018-08-29

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.


RE: Position in a list? - ronie - 2018-08-29

we don't have a ListItem.* infolabel that returns such info afaik.


RE: Position in a list? - User 405025 - 2018-08-29

$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