[rygel] core: Support for search by album and artist



commit 7298eb8f263ef0421384f13fca1217bb0fb8eb9f
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Wed Aug 25 17:41:24 2010 +0300

    core: Support for search by album and artist

 src/rygel/rygel-relational-expression.vala |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/src/rygel/rygel-relational-expression.vala b/src/rygel/rygel-relational-expression.vala
index 81232ff..476ed20 100644
--- a/src/rygel/rygel-relational-expression.vala
+++ b/src/rygel/rygel-relational-expression.vala
@@ -27,7 +27,8 @@ using GUPnP;
 public class Rygel.RelationalExpression :
              Rygel.SearchExpression<SearchCriteriaOp,string,string> {
     internal const string CAPS = "@id,@parentID,upnp:class," +
-                                 "dc:title,dc:creator,upnp:createClass";
+                                 "dc:title,upnp:artist,upnp:album," +
+                                 "dc:creator,upnp:createClass";
 
     public override bool satisfied_by (MediaObject media_object) {
         switch (this.operand1) {
@@ -51,6 +52,18 @@ public class Rygel.RelationalExpression :
             }
 
             return this.compare_string ((media_object as PhotoItem).creator);
+        case "upnp:artist":
+            if (!(media_object is MusicItem)) {
+                return false;
+            }
+
+            return this.compare_string ((media_object as MusicItem).artist);
+        case "upnp:album":
+            if (!(media_object is MusicItem)) {
+                return false;
+            }
+
+            return this.compare_string ((media_object as MusicItem).album);
         default:
             return false;
         }



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