[rygel] core: Search on non-searchable returns no results



commit e74c4b546f12bc46af71d219db7434f0e17317b1
Author: Sunil Mohan Adapa <sunil medhas org>
Date:   Fri Nov 26 01:25:02 2010 +0530

    core: Search on non-searchable returns no results
    
    Search on a non-searchable container returns no results as per
    UPnP A/V ContentDirectory specification.

 src/rygel/rygel-search.vala |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/rygel/rygel-search.vala b/src/rygel/rygel-search.vala
index 13c898f..dd5231e 100644
--- a/src/rygel/rygel-search.vala
+++ b/src/rygel/rygel-search.vala
@@ -57,8 +57,11 @@ internal class Rygel.Search:  Rygel.MediaQueryAction {
     protected override async MediaObjects fetch_results
                                         (MediaObject media_object)
                                          throws Error {
-        var container = media_object as SearchableContainer;
+        if (!(media_object is SearchableContainer)) {
+            return new MediaObjects ();
+        }
 
+        var container = media_object as SearchableContainer;
         var parser = new Rygel.SearchCriteriaParser (this.search_criteria);
         yield parser.run ();
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]