[rygel] core: Fix regression on downgrade for Allegro



commit 975223add6f060abeef55f4fb952d8eb4c413524
Author: Jens Georg <mail jensge org>
Date:   Tue Jul 12 16:37:13 2011 +0200

    core: Fix regression on downgrade for Allegro

 src/rygel/rygel-browse.vala     |    2 +-
 src/rygel/rygel-xbox-hacks.vala |   10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/src/rygel/rygel-browse.vala b/src/rygel/rygel-browse.vala
index 8384636..b45f5d0 100644
--- a/src/rygel/rygel-browse.vala
+++ b/src/rygel/rygel-browse.vala
@@ -40,7 +40,7 @@ internal class Rygel.Browse: Rygel.MediaQueryAction {
         base (content_dir, action);
 
         if (this.xbox_hacks != null) {
-            this.object_id_arg = "ContainerID";
+            this.object_id_arg = this.xbox_hacks.object_id;
         } else {
             this.object_id_arg = "ObjectID";
         }
diff --git a/src/rygel/rygel-xbox-hacks.vala b/src/rygel/rygel-xbox-hacks.vala
index 1493b3a..181473c 100644
--- a/src/rygel/rygel-xbox-hacks.vala
+++ b/src/rygel/rygel-xbox-hacks.vala
@@ -35,6 +35,10 @@ internal class Rygel.XBoxHacks : GLib.Object {
     private static string FRIENDLY_NAME_POSTFIX = ":";
     private static string MODEL_NAME = "Windows Media Player Sharing";
     private static string MODEL_VERSION = "11";
+    private static string CONTAINER_ID = "ContainerID";
+    private static string OBJECT_ID = "ObjectID";
+
+    public unowned string object_id { get; private set; }
 
     public XBoxHacks.for_action (ServiceAction action) throws XBoxHacksError {
         unowned MessageHeaders headers = action.get_message ().request_headers;
@@ -53,6 +57,12 @@ internal class Rygel.XBoxHacks : GLib.Object {
             !(agent.contains ("Allegro-Software-WebClient"))) {
             throw new XBoxHacksError.NA (_("Not Applicable"));
         }
+
+        if (agent.contains ("XBox")) {
+            this.object_id = CONTAINER_ID;
+        } else {
+            this.object_id = OBJECT_ID;
+        }
     }
 
     public bool is_album_art_request (Soup.Message message) {



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