v20 Having Trouble With ListItem.Tag
#1
So, hoping someone can't help me with this.  It is driving me bonkers.  I have made a duplicate of the Estuary skin to practice modding.  Very simply, I'm trying to print the value of Custom Video Library Tags for movie titles on various windows using the InfoLabel ListItem.Tag.  Just about every other ListItem label prints the expected value (Plot, Tagline, AudioCodec, Year, Genre, Etc.).  But for some reason I cannot get ListItem.Tag to work on any screen other than the Video Info Screen (DialogVideoInfo.xml).  

Using the Includes.xml file, modifying this section (Line 6-13) works for the MediaFlags when shown on the Video Info Screen but not on the Home or Movie Library screens.

Includes:
<include content="MediaFlag">
                    <param name="texture" value="$INFO[$PARAM[infolabel_prefix]ListItem.AudioCodec,flags/audiocodec/,.png]" />
                    <param name="visible" value="!String.IsEmpty($PARAM[infolabel_prefix]ListItem.AudioCodec)" />
                </include>

                <include content="MediaFlag">
                    <param name="texture" value="flags/audiocodec/atmos.png" />
                    <param name="visible" value="String.IsEqual($PARAM[infolabel_prefix]ListItem.Tag,ATMOS)" />
                </include>
                <include content="MediaFlag">
                    <param name="texture" value="flags/audiocodec/dtsx.png" />
                    <param name="visible" value="String.IsEqual($PARAM[infolabel_prefix]ListItem.Tag,DTS:X)" />
                </include>
                
                
                <include content="MediaFlag">
                    <param name="texture" value="$INFO[$PARAM[infolabel_prefix]ListItem.AudioChannels,flags/audiochannel/,.png]" />
                    <param name="visible" value="!String.IsEmpty($PARAM[infolabel_prefix]ListItem.AudioChannels)" />
                </include>

Not Working on Home Screen
Image
Works on Video Info Screen

Image
The Video Info screen (controlled by DialogVideoInfo.xml) shows the Custom Tag exists in Kodi for the movie and that the code in Includes.xml displays  the "ATMOS" box in the media flags at the bottom.  But on the Home Screen that Media Flag won't show.

Just for the sake of it, this code shows that trying to place that Custom Tag on Movie Library window also doesn't work but will work when changing the ListItem to something else like Year. (file is MyVideoNav.xml)

MyVideoNav_Year:
<include content="InfoDialogMetadata">
                        <param name="control_id" value="158" />
                        <param name="label" value="[COLOR button_focus]$LOCALIZE[20459]: [/COLOR]$INFO[ListItem.Year]" />
                        <param name="altlabel" value="$LOCALIZE[20459]: $INFO[ListItem.Year]" />
                        <param name="visible" value="!String.IsEmpty(ListItem.Year)" />
                    </include>
Image
Changing the code to ListItem.Tag the value won't show.  I hardcoded the visible field to "TRUE" just to show that "Tags:" will show but not the value that should be displayed by ListItem.Tag.

MyVideoNav_Tag:
<include content="InfoDialogMetadata">
                        <param name="control_id" value="158" />
                        <param name="label" value="[COLOR button_focus]$LOCALIZE[20459]: [/COLOR]$INFO[ListItem.Tag]" />
                        <param name="altlabel" value="$LOCALIZE[20459]: $INFO[ListItem.Tag]" />
                        <param name="visible" value="TRUE" />
                    </include>
Image
I really hope someone knows what I'm missing here.  Thanks for the help.
Reply
#2
fwiw it looks like the tag was not set and is therefor empty

you could try to set the tag and then read it to test your code - https://alwinesch.github.io/group__pytho...titem.html
Reply
#3
Thank you jepsizofye.  I appreciate the reply, but I'm not sure I quite follow.  ListItem.Tag is a built-in Kodi InfoLabel, not custom.  I'm trying to use what is already available in Kodi rather than dive into creating python scripts.  ListItem.Tag shows the result on the Video Info screen (as default in Estuary) but not on any other screen, in any position.  The xml code I am using comes straight from existing Estuary code, just repurposed.  Thanks for the help.
Reply
#4
you are copying code from video info dialog which is intended to be used with the video info dialog window - https://github.com/xbmc/xbmc/blob/master...eoInfo.cpp

that window explicitly sets the video info tag for use by the skin as listitem.tag

you are pasting that code to a different window video nav - https://github.com/xbmc/xbmc/blob/master...deoNav.cpp

which may not explicitly set the video info tag

i do not believe videoinfowindow is using the selected listitem from videonav "as-is" because of this function - https://github.com/xbmc/xbmc/blob/master....cpp#L1844


so, what im suggesting, for testing purposes (rather than copy paste code) is that you actually SET the property explicitly to see if your existing code works

if you set it and it does not display - your code is at fault
if you set it and it does display - the tag is not set by video nav
Reply
#5
Thank you.  I do get what you are saying.  And that was my first thought, that the property is not being set when using the video nav screen.  So, sorry for asking this but would you mind giving me a SET code example and it's location.  I know that is such a noob question, it's just that I have a hard time visualizing it without seeing the code inline.  I would greatly appreciate it, but no worries if not.  Thanks jepsizofye
Reply
#6
(2023-05-11, 07:06)jepsizofye Wrote: fwiw it looks like the tag was not set and is therefor empty

you could try to set the tag and then read it to test your code - https://alwinesch.github.io/group__pytho...titem.html

there are already examples in the link from my first response ^^^^^
Reply

Logout Mark Read Team Forum Stats Members Help
Having Trouble With ListItem.Tag0