Sign up here and you can log into the forum!

Search functionality explained

Discussion, features, plugins--everything about zoster's UMSP UPnP Media Server software

Search functionality explained   

Postby zoster » Mon Aug 02, 2010 11:32 pm

Here's how the Search functionality works:

The individual plugins have to support Search. To do this you have to include a "_pluginSearch" function (see Shoutcast for an example).
Since the WDTV always sends a search query with the ContainerID "0" (the root menu) we don't really know where the user currently is. To work around this everytime the user starts a plugin its name is stored in a /tmp file. That plugin name is read upon a Search action and its _pluginSearch function is called.

The _pluginSearch function receives the full SearchCriteria string which usually looks like this:

Code: Select all
(upnp:class derivedfrom "object.item.videoItem") and dc:title contains "<The Search Term you entered>"


The _pluginSearch function is then supposed to return an array of media items just like the _pluginMain function.
zoster
WDLXTV Team
 
Posts: 218
Joined: Wed Apr 14, 2010 10:14 am

Re: Search functionality explained   

Postby sombragris » Sat Dec 18, 2010 11:55 am

Do you know if there is any chance to add new criteria? For example changing "title" to "Artist" in order to allow diferent searches to be conducted.
sombragris
WDTVer
 
Posts: 34
Joined: Fri Dec 03, 2010 8:30 am
Location: Spain

Re: Search functionality explained   

Postby zoster » Sun Dec 19, 2010 2:05 pm

The music and pictures search has some additional attributes but they are all hardwired. What you could do is to come up with some sort of tag system like "a: <search term>" to search for artists. The parsing would be up to your search implementation.
zoster
WDLXTV Team
 
Posts: 218
Joined: Wed Apr 14, 2010 10:14 am

Re: Search functionality explained   

Postby sombragris » Mon Dec 20, 2010 3:43 am

Thanks zoster.

I think I'll use the "genre" to make expanded searches as it seems the most useless search on the web (and it could easily be implemented menu driven).

After reading your post I've made some tests, and I'll leave here the strings I've found for the _pluginSearch method for feedback:

By Title
Code: Select all
(upnp:class derivedfrom "object.item.audioItem.musicTrack") and dc:title contains "<The Search Term you entered>"


By Album
Code: Select all
(upnp:class derivedfrom "object.item.audioItem.musicTrack") and upnp:album contains "<The Search Term you entered>"


By Genre
Code: Select all
(upnp:class derivedfrom "object.item.audioItem.musicTrack") and upnp:genre contains "<The Search Term you entered>"


Please note, if the search is conducted through the music menu entry then the upnp:class is derived from "object.item.audioItem.musicTrack" if it was conducted through the video menu entry then the upnp:class is derived from "object.item.videoItem"
sombragris
WDTVer
 
Posts: 34
Joined: Fri Dec 03, 2010 8:30 am
Location: Spain

Re: Search functionality explained   

Postby avkiev » Tue Mar 22, 2011 4:11 pm

How to execute (emulate... force...) "Search" ?
Can I in my plugin create some folder (or item) with name "Run Search" with such property: pressing Enter on it - equivalent to pressing "Search" button on remote ?
avkiev
Developer
 
Posts: 167
Joined: Tue Apr 27, 2010 5:02 am
Location: Ukraine, Kiev

Re: Search functionality explained   

Postby mad_ady » Wed Mar 23, 2011 2:22 am

@avkiev: There are 2 ways of doing it (assuming you don't want to test it by pressing search on the remote):

1. Use a web browser and navigate to http://&lt;your.wdtv.ip&gt;/umsp/umsp-test.php. Navigate to your plugin and if search is implemented you'll see a search box on your page and you can test the search functionality really easily
2. You can implement an item that when called would pass a special argument to your UMSP script (something like doSearch=xxx). Then, on the server side you can test for this and call your search function. But beware - you can't ask for user text in this step, since the OSD will not display a keyboard.

Hope this helps.
User avatar
mad_ady
Developer
 
Posts: 4522
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: Search functionality explained   

Postby avkiev » Wed Mar 23, 2011 3:04 am

mad_ady wrote:if search is implemented you'll see a search box on your page

I have Search in my plugin. I want too have item with functionality "Search"

mad_ady wrote:But beware - you can't ask for user text

That is my question. How to force User Input Dialog without pressing Search button ?
avkiev
Developer
 
Posts: 167
Joined: Tue Apr 27, 2010 5:02 am
Location: Ukraine, Kiev

Re: Search functionality explained   

Postby avkiev » Wed Mar 23, 2011 3:46 am

The solution is: exec("echo E > /tmp/ir_injection");
E - it is Search
Can't try it now, but I hope it''ll works
avkiev
Developer
 
Posts: 167
Joined: Tue Apr 27, 2010 5:02 am
Location: Ukraine, Kiev

Re: Search functionality explained   

Postby mad_ady » Wed Mar 23, 2011 4:45 am

:)) Clever. You might need to run it through sudo, since apache is a different user and might not have the necessary privileges.

Question - why do you want to do that? What's wrong with the search button?
User avatar
mad_ady
Developer
 
Posts: 4522
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: Search functionality explained   

Postby avkiev » Wed Mar 23, 2011 4:57 am

mad_ady wrote:Question - why do you want to do that? What's wrong with the search button?

Because Search is invisible.
Many users even don't know that some plugins has a Search function
avkiev
Developer
 
Posts: 167
Joined: Tue Apr 27, 2010 5:02 am
Location: Ukraine, Kiev

Next

Return to UMSP Media Server

Who is online

Users browsing this forum: No registered users and 3 guests