Solved Live Search for Library
#1
I'm trying to get a search for movies/tv shows on my ViewsVideoLibrary.xml so that when I type, it will filter out the movies that match what is typed on key up in the edit control. Right now I have it so that after you are done typing you can press directional key (down, right, etc.) to get the search to be performed but I'd like to have it so that it happens with each key press (like it does with the filter modal). 

Here are the basic elements of my view:
xml:

    <variable name="movieXSP">
        <value condition="Control.IsVisible(60103)">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%22$INFO[Control.GetLabel(60103).index(1)]%22%7D%5D%7D%2C%22type%22%3A%22movies%22%7D</value>
    <!-- videodb://movies/titles/?xsp={"order":{"direction":"ascending","ignorefolders":0,"method":"sorttitle"},"rules":{"and":[{"field":"title","operator":"contains","value":"$INFO[Control.GetLabel(60103).index(1)]"}]},"type":"movies"} -->
    </variable>

        <control type="edit" id="60103">
            <top>170</top>
            <visible>Control.HasFocus(60103) | Container(60101).HasFocus(4)</visible>
            <onup>Container.Update($VAR[movieXSP],replace)</onup>
            <ondown>Container.Update($VAR[movieXSP],replace)</ondown>
            <onleft>Container.Update($VAR[movieXSP],replace)</onleft>
            <onright>Container.Update($VAR[movieXSP],replace)</onright>
            <onup>SetFocus(60101,3)</onup>
            <ondown>SetFocus(601)</ondown>
            <description>Search string</description>
            <hinttext>Search...Press down/right to see results for now</hinttext>
            <width>790</width>
            <height>40</height>
            <font>font30</font>
            <textcolor>white</textcolor>
            <texturefocus/>
            <texturenofocus/>
            <align>left</align>
        </control>

Just so it makes a little more sense (hopefully), here are screen shots of what it looks like: 
Image

Image

Any help would be greatly appreciated!

Thanks,
Doc
Reply
#2
(2022-04-27, 20:48)Doctor Eggs Wrote: I'm trying to get a search for movies/tv shows on my ViewsVideoLibrary.xml so that when I type, it will filter out the movies that match what is typed on key up in the edit control. Right now I have it so that after you are done typing you can press directional key (down, right, etc.) to get the search to be performed but I'd like to have it so that it happens with each key press (like it does with the filter modal). 

Here are the basic elements of my view:
xml:

    <variable name="movieXSP">
        <value condition="Control.IsVisible(60103)">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%22$INFO[Control.GetLabel(60103).index(1)]%22%7D%5D%7D%2C%22type%22%3A%22movies%22%7D</value>
    <!-- videodb://movies/titles/?xsp={"order":{"direction":"ascending","ignorefolders":0,"method":"sorttitle"},"rules":{"and":[{"field":"title","operator":"contains","value":"$INFO[Control.GetLabel(60103).index(1)]"}]},"type":"movies"} -->
    </variable>

        <control type="edit" id="60103">
            <top>170</top>
            <visible>Control.HasFocus(60103) | Container(60101).HasFocus(4)</visible>
            <onup>Container.Update($VAR[movieXSP],replace)</onup>
            <ondown>Container.Update($VAR[movieXSP],replace)</ondown>
            <onleft>Container.Update($VAR[movieXSP],replace)</onleft>
            <onright>Container.Update($VAR[movieXSP],replace)</onright>
            <onup>SetFocus(60101,3)</onup>
            <ondown>SetFocus(601)</ondown>
            <description>Search string</description>
            <hinttext>Search...Press down/right to see results for now</hinttext>
            <width>790</width>
            <height>40</height>
            <font>font30</font>
            <textcolor>white</textcolor>
            <texturefocus/>
            <texturenofocus/>
            <align>left</align>
        </control>

Just so it makes a little more sense (hopefully), here are screen shots of what it looks like: 
Image

Image

Any help would be greatly appreciated!

Thanks,
Doc

The media view windows, got a built in filter.which are supposed to work like your wish.

https://kodi.wiki/view/List_of_Built_In_...deoNav.xml

you just have to define
your filter control type with the id ="19"

outside of media windows, you'll have to use something like the following.

ex for artists,which i use

xml:

<variable name="filtercontent_artists_contains_artist">
<value condition="!String.IsEmpty(Control.GetLabel(8001).index(1))">musicdb://artists/?
xsp=%7B%22rules%22%3A%7B%22and%22%3A%5B%7B%22field%22%3A%22artist%22%2C%22operator%22%3A%22contains%22%2C%22value%22%3A%5B%22$INFO[Control.GetLabel(8001).index(1)]%22%5D%7D%5D%7D%2C%22type%22%3A%22artists%22%7D</value>
<value>musicdb://artists/</value>
</variable>
Skins |  Titan M O D   •   S W A N (WIP)
Reply
#3
This is EXACTLY what I needed. Thank you soooo much @mardukL 

I didn't realize that I could put that id value where I needed and it would act just like the filter. That link to the List of Built In Controls will save me a ton of time as well so thanks to whoever put together that wiki entry.

Thanks again!
Reply

Logout Mark Read Team Forum Stats Members Help
Live Search for Library0