• 1(current)
  • 2
  • 3
  • 4
  • 5
  • 8
Apply custom filtering to dynamic content?
#1
Hi,

Does anyone know of a way to apply custom filtering to dynamic content in a way similar to a smart playlist?

I noticed that the Container.FolderPath of a custom node basically uses JSON style formating - but it doesn't seem to work if I use it as a content path:

e.g. a custom node for title matching Alien is
videodb://movies/titles/?xsp%7b%22rules%22%3a%7b%22and%22%3a%5b%7b%22field%22%3a%22title%22%2c%22operator%22%3a%22is%22%2c%22value%22%3a%5b%22Alien%22%5d%7d%5d%7d%2c%22type%22%3a%22movies%22%7d

which is translates to:
videodb://movies/titles/?xsp{"rules":{"and":[{"field":"title","operator":"is","value":["Alien"]}]},"type":"movies"}

But if I stick either in <content> tags or call it with ActivateWindow(), the content is the all titles path (videodb://movies/titles).

Is this even something that is possible? A smartplaylist is out of the question because I need to have dynamically inputted values based upon a window property.
I know this is a long shot, but if something like this can be done then a lot of skinning possibilities open up!
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#2
It is possible, I use it a lot in Embuary. Especially for my "pseudo Globalsearch" integration, which is basically the same output of Globalsearch but only based on the skin engine and xsp paths. You just have to be sure to use the url encoded format.

Example:
Code:
    <variable name="Local.SearchMovies">
        <value condition="!String.IsEmpty(Skin.String(CustomSearchTerm)) + Library.HasContent(movies)">videodb://movies/titles/?xsp=%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%22title%22%2C%22operator%22%3A%22contains%22%2C%22value%22%3A%5B%22$INFO[Skin.String(CustomSearchTerm)]%22%5D%7D%5D%7D%2C%22type%22%3A%22movies%22%7D</value>
    </variable>
    
<variable name="Local.SearchActorMovies">
        <value condition="!String.IsEmpty(Skin.String(CustomSearchTerm)) + Library.HasContent(movies)">videodb://movies/titles/?xsp=%7b%22rules%22%3a%7b%22and%22%3a%5b%7b%22field%22%3a%22actor%22%2c%22operator%22%3a%22is%22%2c%22value%22%3a%5b%22$INFO[Skin.String(CustomSearchTerm)]%22%5d%7d%5d%7d%2c%22type%22%3a%22movies%22%7d</value>
    </variable>
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#3
Here is a example and proof Wink

Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#4
wow, that's pretty amazing!
very nice :-)
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#5
@sualfred - Yours works perfectly! Thanks so much! I wonder why the path I grabbed from the node doesn't work though. Anyway, this works brilliantly for what I need. Big Grin
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#6
@ronie
hehe. Thx.

@jurialmunkey 

Because you had a "=" missing after ?xsp Wink
Quote:videodb://movies/titles/?xsp{"rules":{"and":[{"field":"title","operator":"is","value":["Alien"]}]},"type":"movies"}
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#7
(2019-03-05, 22:57)sualfred Wrote: Because you had a "=" missing after ?xsp Wink
Quote:videodb://movies/titles/?xsp{"rules":{"and":[{"field":"title","operator":"is","value":["Alien"]}]},"type":"movies"}

Ah! I'm such a fool! I was paying so much careful attention to all the url encoding that I completely missed the equals sign.

Anyway, this is such a fantastic tool to have. It's allowed me to replicate a lot of extendedinfo functionality using only local content.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#8
Proof of concept:

Here's local video info being called from videoinfo dialog for movies in the set. This is done entirely with the skinning engine and local content. There is even a breadrcrumb memory so that you can backtrack.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#9
Looks great.

Yep, the backtrack thing is a big plus. And xsp has no Python overhead and blacing fast.
Sadly I wasn't able to do everything with xsp and had to create my Embuary Helper script.
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#10
Oh man, using XSPs is smooth as eggsssss.... haha. you guys don't use mixed content containers at all?
for some unknown reason (to me at least) trying to create mixed content with xsp (using is playlist rules) doesn't work, although this works using the json api.
on top of that, sorting by year seems to not work outside library...
with this filter hack and mixed working, I could ditch most script sources (besides the recommended sort algorithm and a few more).

btw I've upgraded Skin widgets if you're still using it/or interested for ur own scripts...
https://github.com/cartmandos/script.ski...er.widgets
Reply
#11
Code:
<content sortby="year" sortorder="descending">...</content>

Works well. And for mixed content I use my helper script. Like the screenshot attached.


Image
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#12
(2019-03-06, 15:03)sualfred Wrote:
Code:
<content sortby="year" sortorder="descending">...</content>

Works well. And for mixed content I use my helper script. Like the screenshot attached.


Image
 Yeah, but this not customizable, I just tried again, creating an .xsp
Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="movies">
    <name>testmovies</name>
    <match>all</match>
   <order direction="descending">year</order>
</smartplaylist>

then setting it the container's content, returns <order direction="descending">title</order> instead by year.

also for mixed, why wouldn't it work to create, like in your ex., movies & genre is 'thriller', same for tvshows and then a third playlist with 'is playlist' for both and get mixed content for thriller...
Reply
#13
It is customizable based on your skin implementation.
In my case I've just added a widget config dialog to set those things.

Image
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#14
(2019-03-06, 15:38)sualfred Wrote: It is customizable based on your skin implementation.
In my case I've just added a widget config dialog to set those things.

Image[/url]
 Just gave a quick peek at ur code and realized you've implemented an internal widget-select functionality, and using skin shortcuts just for menu,overriding action and building select-nodes, right?
that's neat. but really implementing that to titan is like doing an heart transplant at this point... Big Grin
Reply
#15
Yep, I prefer it in this way and use just the select method of the script. Gives me more control what is going to happen and how. And I can easily bypass strange skinshortcuts bugs like a wrong detected content type etc.
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
  • 1(current)
  • 2
  • 3
  • 4
  • 5
  • 8

Logout Mark Read Team Forum Stats Members Help
Apply custom filtering to dynamic content?0