[rygel] media-export: Use specific UPnP classes



commit baa6f4c4e87e16be20836aa42cc1446f61180e27
Author: Jens Georg <mail jensge org>
Date:   Sat May 28 22:13:17 2011 +0200

    media-export: Use specific UPnP classes
    
    Use proper UPnP classes for the query containers representing albums
    etc.

 ...rygel-media-export-query-container-factory.vala |   21 +++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)
---
diff --git a/src/plugins/media-export/rygel-media-export-query-container-factory.vala b/src/plugins/media-export/rygel-media-export-query-container-factory.vala
index 55d6e65..d78bb19 100644
--- a/src/plugins/media-export/rygel-media-export-query-container-factory.vala
+++ b/src/plugins/media-export/rygel-media-export-query-container-factory.vala
@@ -123,7 +123,26 @@ internal class Rygel.MediaExport.QueryContainerFactory : Object {
                                                  ref title);
 
         if (pattern == null || pattern == "") {
-            return new LeafQueryContainer (cache, expression, id, title);
+            var container =  new LeafQueryContainer (cache,
+                                                     expression,
+                                                     id,
+                                                     title);
+            switch (attribute) {
+                case "upnp:album":
+                    container.upnp_class = MediaContainer.MUSIC_ALBUM;
+                    break;
+                case "dc:creator":
+                case "upnp:artist":
+                    container.upnp_class = MediaContainer.MUSIC_ARTIST;
+                    break;
+                case "upnp:genre":
+                    container.upnp_class = MediaContainer.MUSIC_GENRE;
+                    break;
+                default:
+                    break;
+            }
+
+            return container;
         } else {
             return new NodeQueryContainer (cache,
                                            expression,



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