From 63b429e0e2f4af63c9384d7a80f7534aaacfbb79 Mon Sep 17 00:00:00 2001 From: Jens Georg Date: Sat, 2 Jan 2010 20:58:07 +0100 Subject: [PATCH] media-export: Fix SearchExpression generation --- src/plugins/media-export/rygel-media-export-query-container.vala | 6 ++++-- 1 file 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; } -- 2.7.4