core: Revive lost XBox hacks
authorZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Fri, 23 Jul 2010 15:30:40 +0000 (18:30 +0300)
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Fri, 23 Jul 2010 15:30:40 +0000 (18:30 +0300)
These hacks were accidently lost in 67809c22.

src/rygel/rygel-media-query-action.vala
src/rygel/rygel-xbox-hacks.vala

index 266950c..a5e51af 100644 (file)
@@ -129,7 +129,7 @@ internal abstract class Rygel.MediaQueryAction : GLib.Object, StateMachine {
         }
 
         if (this.xbox_hacks != null) {
-            this.xbox_hacks.translate_container_id (ref this.object_id);
+            this.xbox_hacks.translate_container_id (this, ref this.object_id);
         }
     }
 
index c55315c..df4cee2 100644 (file)
@@ -60,12 +60,18 @@ internal class Rygel.XBoxHacks : GLib.Object {
         device.context.host_path_for_agent (desc_path, server_path, regex);
     }
 
-    public void translate_container_id (ref string container_id) {
-        if (container_id == "1" ||
-            container_id == "4" ||
-            container_id == "5" ||
-            container_id == "6" ||
-            container_id == "7") {
+    public void translate_container_id (MediaQueryAction action,
+                                        ref string       container_id) {
+        if (action is Search &&
+            (container_id == "1" ||
+             container_id == "4" ||
+             container_id == "5" ||
+             container_id == "6" ||
+             container_id == "7") ||
+            (action is Browse &&
+             container_id == "15" ||
+             container_id == "14" ||
+             container_id == "16")) {
             container_id = "0";
         }
     }