#95 Support @parentID in search

closed
None
5
2014-02-07
2014-01-31
Florian Will
No

Grilo is a library for accessing media files from various sources (including UPnP) that is used by some gnome tools (rhythmbox, gnome-music and I guess some more) and for example also Ubuntu Touch. Probably not all of them use the UPnP feature of grilo.

Under certain conditions (when a filter is set), grilo-upnp uses the "Search" action with @parentID conditions for browsing instead of "Browse".

It seems like ReadyMedia does not support @parentID in a search query, though that feature could be easy to add, since @id and @refID appear to be supported already and it seems to be supported by the SQL schema. So it might be a few lines patch, but I don't know the source well enough to be sure.

Adding @parentID support for searches should improve compatibility with any software using grilo.

Discussion

  • Justin Maggard
    Justin Maggard
    2014-02-04

    This should now be supported in the latest code from git master.

     
  • Florian Will
    Florian Will
    2014-02-04

    You're right, I wonder how I missed that. I was probably browsing an old source tree (or I was really tired?!). Thanks :-)

    I haven't tried the code yet. I'm not 100% sure it works with grilo-upnp, because grilo uses a @parentID = "0" search to browse the root dir. A search query might not return objectIDs that don't contain the "$" delimiter because of the "(OBJECT_ID glob '%q$*')" clause. All of the root dir contents in my case ("Browse Folders", "Music", ...) have simple integer IDs (1,2,3 and 64), so a search won't find them. Maybe that has changed with git master, otherwise I see a problem (that may or may not actually exist) with @parentID=0 search.

     
  • Justin Maggard
    Justin Maggard
    2014-02-04

    Yes, you're right. I have just committed a fix for that last issue.

     
  • Florian Will
    Florian Will
    2014-02-04

    Wow, that was a fast fix! Can't find donation button
    Let me know if you want me to test if git master works for me. Otherwise, I'll use my locally-patched-to-workaround-issue version of rhythmbox until a new ReadyMedia release with this feature hits arch linux ARM repos (compiling for raspberry pi is slow etc.).

     
  • Justin Maggard
    Justin Maggard
    2014-02-05

    Donations might get a little confusing, since the project is more-or-less sponsored by NETGEAR. :-)

    If it's not trivial for you to test my change, can you post a Search request that should have failed before the fix? Thanks!

     
  • Florian Will
    Florian Will
    2014-02-05

    Alright, will try to buy wifi equipment from NETGEAR when I need something new :)

    Actually compiling minidlna turned out to be pretty fast on the raspi, only autotools were relatively slow.. And I can now confirm that rhythmbox+grilo-upnp plugin works fine with current minidlna git master (65fb740) while it fails with minidlna 1.1.1.

    Versions of rhythmbox and grilo-upnp are the same as in Ubuntu 13.10 repos, but rhythmbox was recompiled to include the grilo plugin. Hopefully Ubuntu 14.04 includes that by default, seems like they are finally moving grilo to their main component..

    For reference, these are the search criteria used by grilo-upnp for browsing the root directory as printed by minidlna -d:
    ( ( upnp:class derivedfrom "object.item.audioItem" ) or upnp:class derivedfrom "object.container" ) and @parentID = "0"

    This is the SQL created by git master:
    SELECT o.OBJECT_ID, o.PARENT_ID, o.REF_ID, o.DETAIL_ID, o.CLASS, d.SIZE, d.TITLE, d.DURATION, d.BITRATE, d.SAMPLERATE, d.ARTIST, d.ALBUM, d.GENRE, d.COMMENT, d.CHANNELS, d.TRACK, d.DATE, d.RESOLUTION, d.THUMBNAIL, d.CREATOR, d.DLNA_PN, d.MIME, d.ALBUM_ART, d.DISC from OBJECTS o left join DETAILS d on (d.ID = o.DETAIL_ID) where OBJECT_ID glob '**' and (( ( o.CLASS like "item.audioItem%" ) or o.CLASS like "container%" ) and PARENT_ID = "0") group by DETAIL_ID limit 0, 50

     
  • Florian Will
    Florian Will
    2014-02-05

    Uhm, sourceforge converted my HTML-escaped & quot; to actual quotation marks in the search criteria I posted above. All of the quotation marks are actually HTML-escaped.

     
  • Justin Maggard
    Justin Maggard
    2014-02-07

    Awesome, thanks for testing and posting that info!

     
  • Justin Maggard
    Justin Maggard
    2014-02-07

    • status: open --> closed
    • assigned_to: Justin Maggard