[rygel] media-db: Add possibilty for meta-data field query



commit 34a1864dd5da8d9d688d0a55eeefc3b39eb6f276
Author: Jens Georg <mail jensge org>
Date:   Fri Jan 1 18:20:41 2010 +0100

    media-db: Add possibilty for meta-data field query

 src/rygel/rygel-media-db.vala |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/src/rygel/rygel-media-db.vala b/src/rygel/rygel-media-db.vala
index 6a37bf1..285b442 100644
--- a/src/rygel/rygel-media-db.vala
+++ b/src/rygel/rygel-media-db.vala
@@ -904,4 +904,25 @@ public class Rygel.MediaDB : Object {
         return "%s %s ?".printf (column, func);
     }
 
+    public Gee.List<string> get_meta_data_column_by_filter (
+                                       string          column,
+                                       string          filter,
+                                       GLib.ValueArray args,
+                                       long            offset,
+                                       long            max_count) throws Error {
+        GLib.Value v = offset;
+        args.append (v);
+        v = max_count;
+        args.append (v);
+        var data = new ArrayList<string> ();
+        Rygel.Database.RowCallback cb = (stmt) => {
+            data.add (stmt.column_text (0));
+        };
+
+        this.db.exec (("SELECT DISTINCT %s FROM meta_data AS m %s " +
+                      "ORDER BY %s LIMIT ?,?").printf(column, filter, column),
+                      args.values, cb);
+
+        return data;
+    }
 }



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