Kodi Community Forum
Apply custom filtering to dynamic content? - 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: Apply custom filtering to dynamic content? (/showthread.php?tid=341640)

Pages: 1 2 3 4 5 6 7 8


RE: Apply custom filtering to dynamic content? - sualfred - 2019-07-18

I assume it's the "&" in the title.
To confirm, can you please try to hardcode it with "Burke%20%26%20Hare" to see if that works?


RE: Apply custom filtering to dynamic content? - mardukL - 2019-07-18

(2019-07-18, 16:41)sualfred Wrote: I assume it's the "&" in the title.
To confirm, can you please try to hardcode it with "Burke%20%26%20Hare" to see if that works?

Confirmed.
Titles containing '&' (abd maybe some other signs) dint get results.

Did you know a workaround,or can think of one to try ?


RE: Apply custom filtering to dynamic content? - sualfred - 2019-07-18

Try my github version of the helper
https://github.com/sualfred/script.embuary.helper

Add this to DialogVideoInfo:
<onload>RunScript(script.embuary.helper,action=encode,string='"$INFO[ListItem.TVShowTitle]"',prop=TVShowTitle)</onload>
<onunload>ClearProperty(TVShowTitle,home)</onunload>

And then you should be able to use $INFO[Window(home).Property(TVShowTitle)] to get the provided string as encoded one for your xsp node.


RE: Apply custom filtering to dynamic content? - mardukL - 2019-07-18

(2019-07-18, 18:34)sualfred Wrote: Try my github version of the helper
https://github.com/sualfred/script.embuary.helper

Add this to DialogVideoInfo:
<onload>RunScript(script.embuary.helper,action=encode,string='"$INFO[ListItem.TVShowTitle]"',prop=TVShowTitle)</onload>
<onunload>ClearProperty(TVShowTitle,home)</onunload>

And then you should be able to use $INFO[Window(home).Property(TVShowTitle)] to get the provided string as encoded one for your xsp node.

Wow, thanks for fast response.
Will test it tomorrow.
Thanks again.


RE: Apply custom filtering to dynamic content? - mardukL - 2019-07-19

(2019-07-18, 18:34)sualfred Wrote: Try my github version of the helper
https://github.com/sualfred/script.embuary.helper

Add this to DialogVideoInfo:
<onload>RunScript(script.embuary.helper,action=encode,string='"$INFO[ListItem.TVShowTitle]"',prop=TVShowTitle)</onload>
<onunload>ClearProperty(TVShowTitle,home)</onunload>

And then you should be able to use $INFO[Window(home).Property(TVShowTitle)] to get the provided string as encoded one for your xsp node.

Thanks alot.
Working Pretty great.

Using onload
xml:
<onload condition="[ContainerContent(episodes) | String.IsEqual(ListItem.DBTYPE,episode)] + [Skin.HasSetting(UseEnhancedDialog) + !Skin.HasSetting(UseExtendedInfoDialog)]">RunScript(script.embuary.helper,action=encode,string='"$INFO[ListItem.TVShowTitle]"',prop=DecodedTitle)</onload>
    <onload condition="![ContainerContent(episodes) | String.IsEqual(ListItem.DBTYPE,episode)] + [Skin.HasSetting(UseEnhancedDialog) + !Skin.HasSetting(UseExtendedInfoDialog)]">RunScript(script.embuary.helper,action=encode,string='"$INFO[ListItem.Label]"',prop=DecodedTitle)</onload>
<onunload>ClearProperty(DecodedTitle,home)</onunload>
   

And use as content
xml:

movie
%7B%22order%22%3A%7B%22direction%22%3A%22ascending%22%2C%22ignorefolders%22%3A0%2C%22method%22%3A%22sorttitle%22%7D%2C%22rules%22%3A%7B%22and%22%3A%5B%7B%22field%22%3A%22actor%22%2C%22operator%22%3A%22contains%22%2C%22value%22%3A%5B%22$INFO[Container(8601).ListItem.Label]%22%5D%7D%2C%7B%22field%22%3A%22title%22%2C%22operator%22%3A%22isnot%22%2C%22value%22%3A%5B%22$INFO[Window(home).Property(DecodedTitle)]%22%5D%7D%5D%7D%2C%22type%22%3A%22movies%22%7D
shows
%7B%22order%22%3A%7B%22direction%22%3A%22ascending%22%2C%22ignorefolders%22%3A0%2C%22method%22%3A%22sorttitle%22%7D%2C%22rules%22%3A%7B%22and%22%3A%5B%7B%22field%22%3A%22actor%22%2C%22operator%22%3A%22contains%22%2C%22value%22%3A%5B%22$INFO[Container(8601).ListItem.Label]%22%5D%7D%2C%7B%22field%22%3A%22title%22%2C%22operator%22%3A%22isnot%22%2C%22value%22%3A%5B%22$INFO[Window(home).Property(DecodedTitle)]%22%5D%7D%5D%7D%2C%22type%22%3A%22tvshows%22%7D



RE: Apply custom filtering to dynamic content? - sualfred - 2019-07-19

Great.

But the prop has to be EncodedTitle, because you are encoding something Wink


RE: Apply custom filtering to dynamic content? - mardukL - 2019-07-19

(2019-07-19, 09:42)sualfred Wrote: Great.

But the prop has to be EncodedTitle, because you are encoding something Wink

Oops, ... ;-)


RE: Apply custom filtering to dynamic content? - bsoriano - 2019-09-03

@sualfred, @jurialmunkey  how would I code more complex syntax for this?

I have this right now to check for movies where the main cast members of the current movie appear in:

xml:

videodb://movies/titles/?xsp=%7B%22rules%22%3A%7B%22or%22%3A%5B%7B%22field%22%3A%22actor%22%2C%22operator%22%3A%22is%22%2C%22value%22%3A%5B%22$INFO[Container(90050).ListItemAbsolute(0).Label]%22%5D%7D%2C%7B%22field%22%3A%22actor%22%2C%22operator%22%3A%22is%22%2C%22value%22%3A%5B%22$INFO[Container(90050).ListItemAbsolute(1).Label]%22%5D%7D%2C%7B%22field%22%3A%22actor%22%2C%22operator%22%3A%22is%22%2C%22value%22%3A%5B%22$INFO[Container(90050).ListItemAbsolute(2).Label]%22%5D%7D%2C%7B%22field%22%3A%22actor%22%2C%22operator%22%3A%22is%22%2C%22value%22%3A%5B%22$INFO[Container(90050).ListItemAbsolute(3).Label]%22%5D%7D%2C%7B%22field%22%3A%22actor%22%2C%22operator%22%3A%22is%22%2C%22value%22%3A%5B%22$INFO[Container(90050).ListItemAbsolute(4).Label]%22%5D%7D%2C%7B%22field%22%3A%22actor%22%2C%22operator%22%3A%22is%22%2C%22value%22%3A%5B%22$INFO[Container(90050).ListItemAbsolute(5).Label]%22%5D%7D%2C%7B%22field%22%3A%22actor%22%2C%22operator%22%3A%22is%22%2C%22value%22%3A%5B%22$INFO[Container(90050).ListItemAbsolute(6).Label]%22%5D%7D%5D%7D%2C%22type%22%3A%22movies%22%7D

I want to add to this that the movie title is not the same as ListItem.Title, to exclude the current movie in the results.  How would I go about this?

Thanks for your help.

Regards,

Bart


RE: Apply custom filtering to dynamic content? - sualfred - 2019-09-03

you cannot mix "or" and "and" with ?xsp.
But you can use https://github.com/sualfred/script.embuary.helper/wiki/Widgets:-Special-content#parse-own-json-calls-to-the-script to create your own JSON call which supports this.


RE: Apply custom filtering to dynamic content? - sualfred - 2019-09-03

@bsoriano 

I've reworked my "getitemsbyactor" function. Maybe it fits to your needs:
https://github.com/sualfred/script.embuary.helper/wiki/Widgets:-Mixed-content#get-more-items-of-random-actor
https://github.com/sualfred/script.embuary.helper/wiki/Widgets:-Mixed-content#get-more-items-by-given-actor

Only available on the GitHub branch atm.


RE: Apply custom filtering to dynamic content? - bsoriano - 2019-09-03

(2019-09-03, 09:10)sualfred Wrote: @bsoriano 

I've reworked my "getitemsbyactor" function. Maybe it fits to your needs:
https://github.com/sualfred/script.embuary.helper/wiki/Widgets:-Mixed-content#get-more-items-of-random-actor
https://github.com/sualfred/script.embuary.helper/wiki/Widgets:-Mixed-content#get-more-items-by-given-actor

Only available on the GitHub branch atm.

@sualfred, thanks a lot! This does almost exactly what I was looking for! Would you consider adding 2 or 3 more actors to the “more items by given actor” widget?

Regards,

Bart


RE: Apply custom filtering to dynamic content? - bsoriano - 2019-09-03

(2019-09-03, 07:40)sualfred Wrote: you cannot mix "or" and "and" with ?xsp.
But you can use https://github.com/sualfred/script.embuary.helper/wiki/Widgets:-Special-content#parse-own-json-calls-to-the-script to create your own JSON call which supports this.

@sualfred, thank you! I looked at this capability of your script, but I could not figure out the JSON call I needed. I admit I was a bit intimidated by the JSON API wiki.

Regards,

Bart


RE: Apply custom filtering to dynamic content? - sualfred - 2019-09-03

Here is an example with multiple actors and a excluded title.

Code:

{'and': [{'or': [{'operator': 'is', 'field': 'actor', 'value': 'Vin Diesel'},{'operator': 'is', 'field': 'actor', 'value': 'Bruce Willis'},{'operator': 'is', 'field': 'actor', 'value': 'Sasha Grey'}]}, {'operator': 'isnot', 'field': 'title', 'value': 'Der Gigant aus dem All'}]}



RE: Apply custom filtering to dynamic content? - bsoriano - 2019-09-03

(2019-09-03, 12:07)sualfred Wrote: Here is an example with multiple actors and a excluded title.

Code:

{'and': [{'or': [{'operator': 'is', 'field': 'actor', 'value': 'Vin Diesel'},{'operator': 'is', 'field': 'actor', 'value': 'Bruce Willis'},{'operator': 'is', 'field': 'actor', 'value': 'Sasha Grey'}]}, {'operator': 'isnot', 'field': 'title', 'value': 'Der Gigant aus dem All'}]}

@sualfred, thank you so much!

Regards,

Bart


RE: Apply custom filtering to dynamic content? - bsoriano - 2019-09-03

(2019-09-03, 12:07)sualfred Wrote: Here is an example with multiple actors and a excluded title.

Code:

{'and': [{'or': [{'operator': 'is', 'field': 'actor', 'value': 'Vin Diesel'},{'operator': 'is', 'field': 'actor', 'value': 'Bruce Willis'},{'operator': 'is', 'field': 'actor', 'value': 'Sasha Grey'}]}, {'operator': 'isnot', 'field': 'title', 'value': 'Der Gigant aus dem All'}]}
@sualfred, should I encode the title into URL format to use in that JSON call or just leave the regular infolabel, such as '$INFO[ListItem.Title]?

Regards,

Bart