[rygel] media-db: Query object meta-data by search expression



commit 62e5e7e2e9c5a1b348aaf140ac9d91bfbfdc7afd
Author: Jens Georg <mail jensge org>
Date:   Sat Jan 30 22:07:10 2010 +0100

    media-db: Query object meta-data by search expression

 src/rygel/rygel-media-db.vala |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/src/rygel/rygel-media-db.vala b/src/rygel/rygel-media-db.vala
index 285b442..830674d 100644
--- a/src/rygel/rygel-media-db.vala
+++ b/src/rygel/rygel-media-db.vala
@@ -925,4 +925,27 @@ public class Rygel.MediaDB : Object {
 
         return data;
     }
+
+    public Gee.List<string> get_object_attribute_by_search_expression (
+                                       string           attribute,
+                                       SearchExpression expression,
+                                       long             offset,
+                                       long             max_count) throws Error {
+        var args = new ValueArray (0);
+        var filter = this.search_expression_to_sql (expression, args);
+        if (filter != null) {
+            filter = " WHERE %s ".printf (filter);
+        } else {
+            filter = "";
+        }
+
+        debug ("Parsed filter: %s", filter);
+
+        var column = this.map_operand_to_column (attribute);
+        return this.get_meta_data_column_by_filter (column,
+                                                    filter,
+                                                    args,
+                                                    offset,
+                                                    max_count);
+    }
 }



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