Apply custom filtering to dynamic content?
#90
(2023-02-27, 22:48)3000 Wrote:
(2023-02-27, 21:57)realcopacetic Wrote:
(2023-02-27, 16:08)3000 Wrote: hi, I found this post while searching for a way to combine movies and tv shows. This is EXACTLY what I'm looking for. Would this also work for multiple video node sources?

Appreciate any help!

The only way 'in skin' to combine movie and TV shows in one list would be using two <content> tags but the list would basically just append the results of the second <content> tag to the end. So if you wanted to sort a filtered group of movies and TV shows by 'last played', it would sort all the movies and then sort all the TV shows and stick the TV shows on the end. So not proper sorting but might work for some use cases.

If you want a combined list with proper sorting behaviour you'll need a plugin addon to build the list for you so quite a bit more work, unless it's a plugin list already included in an existing addon such as embuary helper or tmdb helper.

What are you trying to do?
hi, thank you for your reply!!

I want to separate my movies and tv shows via tags. So movies and tv shows that fit the same tag should appear in one list/place/folder.

So appending sounds very interesting. I'd have movies first, then tv shows of the same tag in one place. Great!

But proper sorting would be really cool too...

Could you explain a bit more? Really appreciate it!

No worries. So you have three options.
1) Doing it in skin with xsp only - it will be quick to get set up and you don't need to worry about addons, but you won't be able to mix your movies and tvshows together. However you sort them, it will always be movie, movie... movie, tvshow tvshow... tvshow. Or vice versa if you put the tvshow <content> tag first. I would recommend you start with this just to see if it works as you want first.

For this to work, you would want to add the following to your list container. You can change sortby and limit as you need. But this will choose 5 movies and 5 tvshows.

xml:

<content sortby="random" limit="5">videodb://movies/titles/</content>
<content sortby="random" limit="5">videodb://tvshows/titles/</content>

Now you want to add the xps filtering to the end of the paths to say that you only want results where the field 'tags' is or contains a certain value. First if the value was hardcoded e.g. the tag you want to filter by was 'football', it would look like this:

<content sortby="random" limit="5">videodb://movies/titles/?xsp=%7B%22rules%22%3A%7B%22and%22%3A%5B%7B%22field%22%3A%22tags%22%2C%22operator%22%3A%22is%22%2C%22value%22%3A%5B%22football%22%5D%7D%5D%7D%2C%22type%22%3A%22movies%22%7D</content>
<content sortby="random" limit="5">videodb://tvshows/titles/videodb://tvshows/titles/?xsp=%7B%22rules%22%3A%7B%22and%22%3A%5B%7B%22field%22%3A%22tags%22%2C%22operator%22%3A%22is%22%2C%22value%22%3A%5B%22football%22%5D%7D%5D%7D%2C%22type%22%3A%22tvshows%22%7D</content>

Few things to note:
json:
{"rules":{"and":[{"field":"tags","operator":"is","value":["football"]}]},"type":"tvshows"}
  • The only difference with these two lines because you want them to filter by the same tag is the bit at the end where type is either 'movies' or 'tvshows'
  • To make it dynamic, you can replace 'football' with an infolabel or var then it would look like:

<content sortby="random" limit="5">videodb://movies/titles/?xsp=%7B%22rules%22%3A%7B%22and%22%3A%5B%7B%22field%22%3A%22tags%22%2C%22operator%22%3A%22is%22%2C%22value%22%3A%5B%22$INFO[XYZ]%22%5D%7D%5D%7D%2C%22type%22%3A%22movies%22%7D</content>
<content sortby="random" limit="5">videodb://tvshows/titles/videodb://tvshows/titles/?xsp=%7B%22rules%22%3A%7B%22and%22%3A%5B%7B%22field%22%3A%22tags%22%2C%22operator%22%3A%22is%22%2C%22value%22%3A%5B%22$INFO[XYZ]%22%5D%7D%5D%7D%2C%22type%22%3A%22tvshows%22%7D</content>
  • Notice that the infolabel doesn't get encoded it stays as $INFO[] and whatever is in the square brackets also doesn't get encoded, whether it's ListItem.Label or a window property or a skin string or any other place you will get the tag from that you want to filter by.
  • One other thing to note is that certain characters will break the xsp for instance if the tag has a '/' in it. To get around this, it is recommended you escape the infolabel, by changing $INFO to $ESCINFO. But if you do this, you also need to remove the %22 from either side of the $ESCINFO[] as you no longer need the "" around it.
2) Doing it with an addon
If you install an addon like Embuary Helper, then you just need to find a widget that does what you need it to. I know you can filter any by tag e.g. one of the Mixed Content widgets.

https://github.com/sualfred/script.embua...ed-content
<content sortby="random" limit="5">plugin://script.embuary.helper/?info=getinprogress&tag=HDR</content>

The only thing is that these are filtering by something AND by tag, e.g. by in progress status or genre. I'm not sure if there's one just for filtering by tag.

You can also check TMDB Helper widgets here: https://github.com/jurialmunkey/plugin.v...nal-Params

3) Making your own addon
If there's nothing quite doing what you need then you can always make your own. It's not easy, depending on your competency with Python etc. I've been learning since December and have just about got my addon doing what I want. I can give some limited help here as I've been learning how those addons above work to make my own, so can talk you through the steps, but it depends on your appetite for it.
Reply


Messages In This Thread
RE: Apply custom filtering to dynamic content? - by realcopacetic - 2023-02-28, 00:05
Logout Mark Read Team Forum Stats Members Help
Apply custom filtering to dynamic content?0