Apply custom filtering to dynamic content?
#86
Not sure if I'm running into a syntax issue or what I'm trying to do can't be done...

I was using Embuary Helper's getsimilar widget to populate a container based on the genre of a selected movie. Content path:

xml:

plugin://script.embuary.helper/?info=getsimilar&dbid=$INFO[ListItem.DBID]&type=movie

But I want to stop children's (e.g. UK MPAA ratings U / PG) and older content (e.g. UK MPAA ratings 12A / 15 / 18  / X) from being mixed, so I was trying to recreate this filter in XSP in order to add an additional MPAA condition.

I understand this can be done in a single AND statement in a smart playlist as in the screenshot, so this is my reasoning for hoping it can be done with XSP.

xml:

<smartplaylist type="movies">
    <name>similargenre</name>
    <match>all</match>
    <rule field="genre" operator="is">
        <value>Action</value>
        <value>Thriller</value>
        <value>Science-Fiction</value>
    </rule>
    <rule field="mpaarating" operator="isnot">
        <value>15</value>
        <value>18</value>
    </rule>
</smartplaylist>

Image

Confirmation this works here: https://forum.kodi.tv/showthread.php?tid...pid2960352

But I'm having trouble escaping the strings separated by a "/"... when using them in my XSP string.

This works:

xml:

videodb://movies/titles/?xsp={"rules":{"and":[{"field":"genre","operator":"contains","value":[$ESCINFO[Window(home).Property(GenreSplit.0)]]},{"field":"mpaarating","operator":"isnot","value":[$ESCINFO[ListItem.MPAA]]}]},"type":"movies"}
But I can't find any way to get it to accept values such as "Action / Thriller" using ListItem.Genre or "G / PG" using variables or just hardcoded values in the XSP.

Does anyone know if this is possible? I run into similar problems with my director widget, which uses the following contentpath and can't handle values such as "Joel Cohen / Ethan Cohen"

xml:

videodb://movies/titles/?xsp={"rules":{"and":[{"field":"director","operator":"is","value":[$ESCINFO[ListItem.Director]]}]},"type":"movies"}

Does anyone know if this is possible?
Reply


Messages In This Thread
RE: Apply custom filtering to dynamic content? - by realcopacetic - 2022-05-17, 14:10
Logout Mark Read Team Forum Stats Members Help
Apply custom filtering to dynamic content?0