Bug Crash on Kodi 18 nightly with conditional variable
#1
I display a label on videos window based on the media container focuseditem. The label is a variable. When I add the following to the variable:
Code:
<value condition="![Control.IsVisible(608) | Control.IsVisible(65)] + String.IsEqual(ListItem.DBType,musicvideo) + Window.IsVisible(videos) + String.StartsWith(ListItem.Label,ListItem.Artist)">$INFO[ListItem.Title] - $INFO[ListItem.Album]</value>

Kodi crashes (Exception caught in main loop / Kodi has stopped working) when I focus on one of the listitems in the container.
Kodi Win32 18 0820 nightly. Kodi debug log logs an error when it crashes:
Code:
ERROR: exception in CApplication::FrameMove()

From some testing it seems like the specific problem is the boolean
Code:
String.StartsWith(ListItem.Label,ListItem.Artist)

My full log https://pastebin.com/ffzET9gL

Is that not permitted?

scott s.
.
Reply
#2
Just out of curiosity does the same thing happen if you use String.IsEqual?
Reply
#3
String.IsEqual works (no crash) but of course of no use here. String.StartsWith, String.EndsWith, and String.Contains all trigger the crash. I guess only the first argument can be an infolabel.

scott s.
.
Reply
#4
I only have a single music video for testing but for me the ListItem.Label is the same as ListItem.Title which is the song name.

You want to display "$INFO[ListItem.Title] - $INFO[ListItem.Album]" only when the Label StartsWith the Artist?

I'm not sure if that is a normal thing to happen when you scrape music videos but if there is a pattern then maybe you can use Contains with whatever separator is used like "-" if for example that is used to mark the end of artist name and start of whatever comes after.

Wiki looks like it says only String.IsEqual works when checking $INFOlabel to $INFOlabel.
Reply
#5
What I display currently is a two-line labels:
$INFO[ListItem.label]
$INFO[ListItem.artist]

that mostly gives what I want. But the content of ListItem.label for musicvideo depends on the sorting used.:

sort by:

name or year; Title
artist or track; Aritst - Title
album; Album - Title

So my thought was to avoid the redundant display of Artist in both lines when sort is artist or track. I don't see any way to get the sort method so I hoped to test the Listitem.label itself to see if it was showing airtist - title. I could forgo using ListItem.label at all, but it is convenient to have the "Artist - Title" and "Album - Title" options based on the sort.

scott s.
.
Reply
#6
Ah, I see.

You should be able to use the following for variable condition:
Code:
String.IsEqual(Container.SortMethod,$LOCALIZE[557])
557 is for artists.

Edit: 554 should be track sort.
Reply
#7
Thanks. Works perfectly.

scott s.
.
Reply

Logout Mark Read Team Forum Stats Members Help
Crash on Kodi 18 nightly with conditional variable0