From: Jens Georg Date: Sat, 30 Jan 2010 21:07:10 +0000 (+0100) Subject: media-db: Query object meta-data by search expression X-Git-Tag: RYGEL_0_5_2~100 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=62e5e7e2e9c5a1b348aaf140ac9d91bfbfdc7afd;p=profile%2Fivi%2Frygel.git media-db: Query object meta-data by search expression --- 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 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); + } }