2022-10-11, 13:55
Hi, I've made a Next Episode episode widget that doesn't rely on addons for when people don't have/want Embuary Helper installed on their system, but I'm running into a problem with playing the selected episode. I did this by effectively two lists like so:
So if Embuary Helper is enabled, the widget will use the plugin as content source, but if it isn't, it will use an inprogress smart playlist for tv shows. In this second instance, a secondary list then provides details of the next unplayed episode for the tvshow selected in the primary list. So far, so good.
But for my <onclick> in my primary list, I want to play the episode that is selected in the secondary list (id = 92200). And this is not working.
I thought it would be a simple case of this:
But that gives me the following error:
I think the $INFO should be translated in the log, which seems to indicate that for some reason the <onclick> of a list cannot parse the request. Is it because it's an external list? Any ideas?
I've tried sending a click to 92200 also, but that doesn't work. The only way I can get the functionality to work is by passing focus to 92200 but this means you need an extra click with no perceptible result by the user to pass focus. And also it gives me issues with the way my widget visibility conditions work and I don't really want to redo them all if I can help it.
Anyone got any ideas?
xml:
<include name="Widget_NextUp">
<include condition="System.AddonIsEnabled(script.embuary.helper)" content="Widget_Template">
<param name="widget_position" value="$PARAM[widget_position]"/>
<param name="widget_header" value="$LOCALIZE[31227]"/>
<param name="id" value="$PARAM[id]"/>
<param name="content" value="plugin://script.embuary.helper/?info=getnextup"/>
</include>
<include condition="!System.AddonIsEnabled(script.embuary.helper)" content="Widget_Template">
<param name="widget_position" value="$PARAM[widget_position]"/>
<param name="widget_header" value="$LOCALIZE[31227]"/>
<param name="id" value="$PARAM[id]"/>
<param name="target" value="videos"/>
<param name="content" value="special://skin/extras/playlists/inprogress_tvshows.xsp"/>
<param name="use_custom_click" value="true"/>
<param name="click_action" value="Next_Up"/>
<control type="list" id="92200">
<visible>Control.HasFocus($PARAM[id])</visible>
<itemlayout/>
<focusedlayout/>
<content target="videos" sortby="playcount" sortorder="ascending" limit="1">videodb://inprogresstvshows/$INFO[Container($PARAM[id]).ListItem.DBID]/-2/?xsp=%7B%22rules%22%3A%7B%22and%22%3A%5B%7B%22field%22%3A%22playcount%22%2C%22operator%22%3A%22is%22%2C%22value%22%3A%5B%220%22%5D%7D%5D%7D%2C%22type%22%3A%22episodes%22%7D</content>
</control>
</include>
</include>
So if Embuary Helper is enabled, the widget will use the plugin as content source, but if it isn't, it will use an inprogress smart playlist for tv shows. In this second instance, a secondary list then provides details of the next unplayed episode for the tvshow selected in the primary list. So far, so good.
But for my <onclick> in my primary list, I want to play the episode that is selected in the secondary list (id = 92200). And this is not working.
I thought it would be a simple case of this:
xml:
<onclick>PlayMedia($INFO[Container(92200).ListItem.Filenameandpath])</onclick>
But that gives me the following error:
json:
2022-10-11 12:02:25.059 T:4552 ERROR <general>: Keymapping error: no such action 'playmedia()' defined
2022-10-11 12:02:25.059 T:4552 DEBUG <general>: CApplication::ExecuteXBMCAction: Tried translating, but failed to understand PlayMedia($INFO[Container(92200).ListItem.FileNameAndPath])
I think the $INFO should be translated in the log, which seems to indicate that for some reason the <onclick> of a list cannot parse the request. Is it because it's an external list? Any ideas?
I've tried sending a click to 92200 also, but that doesn't work. The only way I can get the functionality to work is by passing focus to 92200 but this means you need an extra click with no perceptible result by the user to pass focus. And also it gives me issues with the way my widget visibility conditions work and I don't really want to redo them all if I can help it.
Anyone got any ideas?