[rygel] core: Filter unsupported sort criterias from XBox
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] core: Filter unsupported sort criterias from XBox
- Date: Sun, 11 Dec 2011 18:13:02 +0000 (UTC)
commit 0cc5aa9480387a89833b220e47d87ae939571c2d
Author: Jens Georg <mail jensge org>
Date: Sun Nov 27 19:10:01 2011 +0100
core: Filter unsupported sort criterias from XBox
This fixes the "Slideshow" option when selected from top-level picture
browsing dialog.
src/rygel/rygel-client-hacks.vala | 2 ++
src/rygel/rygel-media-query-action.vala | 4 ++++
src/rygel/rygel-xbox-hacks.vala | 8 ++++++++
3 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/rygel/rygel-client-hacks.vala b/src/rygel/rygel-client-hacks.vala
index e3944a5..a867d8e 100644
--- a/src/rygel/rygel-client-hacks.vala
+++ b/src/rygel/rygel-client-hacks.vala
@@ -97,6 +97,8 @@ internal abstract class Rygel.ClientHacks : GLib.Object {
public virtual void apply (MediaItem item) {}
+ public virtual void filter_sort_criteria (ref string sort_criteria) {}
+
public virtual async MediaObjects? search
(SearchableContainer container,
SearchExpression? expression,
diff --git a/src/rygel/rygel-media-query-action.vala b/src/rygel/rygel-media-query-action.vala
index 1db1236..417a205 100644
--- a/src/rygel/rygel-media-query-action.vala
+++ b/src/rygel/rygel-media-query-action.vala
@@ -130,6 +130,10 @@ internal abstract class Rygel.MediaQueryAction : GLib.Object, StateMachine {
this.sort_criteria = DEFAULT_SORT_CRITERIA;
}
+ if (this.hacks != null) {
+ hacks.filter_sort_criteria (ref this.sort_criteria);
+ }
+
this.validate_sort_criteria ();
if (this.hacks != null) {
diff --git a/src/rygel/rygel-xbox-hacks.vala b/src/rygel/rygel-xbox-hacks.vala
index 92c4d0c..4030b30 100644
--- a/src/rygel/rygel-xbox-hacks.vala
+++ b/src/rygel/rygel-xbox-hacks.vala
@@ -98,6 +98,14 @@ internal class Rygel.XBoxHacks : ClientHacks {
}
}
+ public override void filter_sort_criteria (ref string sort_criteria) {
+ sort_criteria = sort_criteria.replace ("+microsoft:sourceURL", "");
+ sort_criteria = sort_criteria.replace (",,", ",");
+ if (sort_criteria.has_prefix (",")) {
+ sort_criteria = sort_criteria.slice (1, sort_criteria.length);
+ }
+ }
+
public override async MediaObjects? search
(SearchableContainer container,
SearchExpression? expression,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]