[rygel: 1/2] media-export: Support the "Genre" folder of XBox



commit 5628ef8f07e4048c7a3bfd396f6e95761b468051
Author: Jens Georg <mail jensge org>
Date:   Fri Aug 27 22:54:35 2010 +0300

    media-export: Support the "Genre" folder of XBox

 .../rygel-media-export-media-cache.vala            |    2 +
 .../rygel-media-export-root-container.vala         |   24 ++++++++++---------
 2 files changed, 15 insertions(+), 11 deletions(-)
---
diff --git a/src/plugins/media-export/rygel-media-export-media-cache.vala b/src/plugins/media-export/rygel-media-export-media-cache.vala
index 688f749..ae87b4c 100644
--- a/src/plugins/media-export/rygel-media-export-media-cache.vala
+++ b/src/plugins/media-export/rygel-media-export-media-cache.vala
@@ -705,7 +705,9 @@ public class Rygel.MediaExport.MediaCache : Object {
                 column = "m.album";
                 use_collation = true;
                 break;
+            case "upnp:genre":
             case "dc:genre":
+                // FIXME: Remove dc:genre, upnp:genre is the correct one
                 column = "m.genre";
                 use_collation = true;
                 break;
diff --git a/src/plugins/media-export/rygel-media-export-root-container.vala b/src/plugins/media-export/rygel-media-export-root-container.vala
index bbbd7fa..ffe1f92 100644
--- a/src/plugins/media-export/rygel-media-export-root-container.vala
+++ b/src/plugins/media-export/rygel-media-export-root-container.vala
@@ -191,25 +191,27 @@ public class Rygel.MediaExport.RootContainer : Rygel.MediaExport.DBContainer {
                                        RelationalExpression expression) {
         if (expression.operand1 == "upnp:class" &&
             expression.op == SearchCriteriaOp.EQ) {
+            string id = QueryContainer.PREFIX;
             switch (expression.operand2) {
                 case "object.container.album.musicAlbum":
-                    string id = "virtual-container:upnp:album,?";
-                    QueryContainer.register_id (ref id);
-
-                    return new QueryContainer (this.media_db,
-                                               id,
-                                               _("Albums"));
+                    id += "upnp:album,?";
 
+                    break;
                 case "object.container.person.musicArtist":
-                    string id = "virtual-container:dc:creator,?,upnp:album,?";
-                    QueryContainer.register_id (ref id);
+                    id += "dc:creator,?,upnp:album,?";
+
+                    break;
+                case "object.container.genre.musicGenre":
+                    id += "dc:genre,?";
 
-                    return new QueryContainer (this.media_db,
-                                               id,
-                                               _("Artists"));
+                    break;
                 default:
                     return null;
             }
+
+            QueryContainer.register_id (ref id);
+
+            return new QueryContainer (this.media_db, id);
         }
 
         return null;



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