[rygel] media-export: Fix SearchExpression generation



commit 63b429e0e2f4af63c9384d7a80f7534aaacfbb79
Author: Jens Georg <mail jensge org>
Date:   Sat Jan 2 20:58:07 2010 +0100

    media-export: Fix SearchExpression generation

 .../rygel-media-export-query-container.vala        |    6 ++++--
 1 files changed, 4 insertions(+), 2 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 cc34cc3..dad123d 100644
--- a/src/plugins/media-export/rygel-media-export-query-container.vala
+++ b/src/plugins/media-export/rygel-media-export-query-container.vala
@@ -39,8 +39,9 @@ internal class Rygel.MediaExportQueryContainer : Rygel.MediaDBContainer {
         //          the parts not prefixed by virtual-folder: are URL-escaped
         base (media_db, id, name);
         var args = id.split(",");
-        var exp = new RelationalExpression ();
-        for (int i = args.length - 2; i >= 1; i -= 2) {
+        for (int i = args.length - 1 - args.length % 2; i >= 1 - args.length %
+        2; i -= 2) {
+            var exp = new RelationalExpression ();
             exp.operand1 = args[i - 1].replace ("virtual-container:", "");
             exp.op = SearchCriteriaOp.EQ;
             exp.operand2 = args[i];
@@ -49,6 +50,7 @@ internal class Rygel.MediaExportQueryContainer : Rygel.MediaDBContainer {
                 exp2.operand1 = this.expression;
                 exp2.operand2 = exp;
                 exp2.op = LogicalOperator.AND;
+                this.expression = exp2;
             } else {
                 this.expression = exp;
             }



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