[rygel] media-export: Don't deal with database internals



commit 4d4f3b2ecd0207fd17a74a73c0507bd66c0bac9d
Author: Jens Georg <mail jensge org>
Date:   Sat Jan 30 22:25:06 2010 +0100

    media-export: Don't deal with database internals
    
    MediaExportQueryContainer should not have access to DB internals.

 .../rygel-media-export-query-container.vala        |   20 +++++---------------
 1 files changed, 5 insertions(+), 15 deletions(-)
---
diff --git a/src/plugins/media-export/rygel-media-export-query-container.vala b/src/plugins/media-export/rygel-media-export-query-container.vala
index 0d332d3..4a0b8cc 100644
--- a/src/plugins/media-export/rygel-media-export-query-container.vala
+++ b/src/plugins/media-export/rygel-media-export-query-container.vala
@@ -23,7 +23,7 @@ using GUPnP;
 
 internal class Rygel.MediaExportQueryContainer : Rygel.MediaDBContainer {
     private bool item_container;
-    private string column;
+    private string attribute;
     private SearchExpression expression;
 
     public MediaExportQueryContainer (MediaDB media_db,
@@ -68,9 +68,8 @@ internal class Rygel.MediaExportQueryContainer : Rygel.MediaDBContainer {
             this.item_container = true;
         } else {
             this.item_container = false;
-            var operand = args[args.length - 1].replace("virtual-container:",
-                                                         "");
-            this.column = this.media_db.map_operand_to_column (operand);
+            this.attribute =
+                    args[args.length - 1].replace("virtual-container:", "");
         }
     }
 
@@ -119,18 +118,9 @@ internal class Rygel.MediaExportQueryContainer : Rygel.MediaDBContainer {
 
         var children = new ArrayList<MediaObject> ();
         try {
-            var args = new ValueArray (0);
-            var filter = this.media_db.search_expression_to_sql (
+            var data = this.media_db.get_object_attribute_by_search_expression (
+                                        this.attribute,
                                         this.expression,
-                                        args);
-            if (filter != null) {
-                filter = " WHERE %s ".printf (filter);
-            }
-            debug ("parsed filter: %s", filter);
-            var data = this.media_db.get_meta_data_column_by_filter (
-                                        this.column,
-                                        filter == null ? "" : filter,
-                                        args,
                                         offset,
                                         max_count == 0 ? -1 : max_count);
             foreach (string meta_data in data) {



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