summarylogtreecommitdiffstats
path: root/0001-Revert-jsonrpc-remove-ambiguous-and-duplicate-Player.patch
diff options
context:
space:
mode:
authorgraysky2020-12-29 15:16:34 -0500
committergraysky2020-12-29 15:16:34 -0500
commit482793b83cda46cfe61421aa4f265d5696782fe0 (patch)
tree6f9661da82070be4abf1ed9174e556aa0513373c /0001-Revert-jsonrpc-remove-ambiguous-and-duplicate-Player.patch
parent0a65a421c0e26c27c61f31aaa98b83377b793350 (diff)
downloadaur-482793b83cda46cfe61421aa4f265d5696782fe0.tar.gz
Update to r56865.af8aded66c1-2
Diffstat (limited to '0001-Revert-jsonrpc-remove-ambiguous-and-duplicate-Player.patch')
-rw-r--r--0001-Revert-jsonrpc-remove-ambiguous-and-duplicate-Player.patch63
1 files changed, 63 insertions, 0 deletions
diff --git a/0001-Revert-jsonrpc-remove-ambiguous-and-duplicate-Player.patch b/0001-Revert-jsonrpc-remove-ambiguous-and-duplicate-Player.patch
new file mode 100644
index 000000000000..29753e79741d
--- /dev/null
+++ b/0001-Revert-jsonrpc-remove-ambiguous-and-duplicate-Player.patch
@@ -0,0 +1,63 @@
+From 88b3174bdc47bfa7fb0e798ef0d01cd0bdf8e734 Mon Sep 17 00:00:00 2001
+From: graysky <graysky@archlinux.us>
+Date: Tue, 29 Dec 2020 14:42:12 -0500
+Subject: [PATCH] Revert "[jsonrpc] remove ambiguous and duplicate Player.Seek
+ options"
+
+This reverts commit 3801ec4b07d74c81d830c83c799ae90228c5cf2e.
+---
+ xbmc/interfaces/json-rpc/PlayerOperations.cpp | 14 +++++++-------
+ xbmc/interfaces/json-rpc/schema/methods.json | 3 +++
+ 2 files changed, 10 insertions(+), 7 deletions(-)
+
+diff --git a/xbmc/interfaces/json-rpc/PlayerOperations.cpp b/xbmc/interfaces/json-rpc/PlayerOperations.cpp
+index 8572736bef..d472a6951f 100644
+--- a/xbmc/interfaces/json-rpc/PlayerOperations.cpp
++++ b/xbmc/interfaces/json-rpc/PlayerOperations.cpp
+@@ -401,11 +401,11 @@ JSONRPC_STATUS CPlayerOperations::Seek(const std::string &method, ITransportLaye
+ return FailedToExecute;
+
+ const CVariant& value = parameterObject["value"];
+- if (value.isMember("percentage"))
+- g_application.SeekPercentage(value["percentage"].asFloat());
+- else if (value.isMember("step"))
++ if (IsType(value, NumberValue) || value.isMember("percentage"))
++ g_application.SeekPercentage(IsType(value, NumberValue) ? value.asFloat() : value["percentage"].asFloat());
++ else if (value.isString() || value.isMember("step"))
+ {
+- std::string step = value["step"].asString();
++ std::string step = value.isString() ? value.asString() : value["step"].asString();
+ if (step == "smallforward")
+ CBuiltins::GetInstance().Execute("playercontrol(smallskipforward)");
+ else if (step == "smallbackward")
+@@ -417,10 +417,10 @@ JSONRPC_STATUS CPlayerOperations::Seek(const std::string &method, ITransportLaye
+ else
+ return InvalidParams;
+ }
+- else if (value.isMember("seconds"))
++ else if (value.isMember("seconds") && value.size() == 1)
+ g_application.GetAppPlayer().GetSeekHandler().SeekSeconds(static_cast<int>(value["seconds"].asInteger()));
+- else if (value.isMember("time"))
+- g_application.SeekTime(ParseTimeInSeconds(value["time"]));
++ else if (value.isObject())
++ g_application.SeekTime(ParseTimeInSeconds(value.isMember("time") ? value["time"] : value));
+ else
+ return InvalidParams;
+
+diff --git a/xbmc/interfaces/json-rpc/schema/methods.json b/xbmc/interfaces/json-rpc/schema/methods.json
+index d23ad943d7..a2e2927b2a 100644
+--- a/xbmc/interfaces/json-rpc/schema/methods.json
++++ b/xbmc/interfaces/json-rpc/schema/methods.json
+@@ -295,6 +295,9 @@
+ "params": [
+ { "name": "playerid", "$ref": "Player.Id", "required": true },
+ { "name": "value", "required": true, "type": [
++ { "$ref": "Player.Position.Percentage", "required": true, "description": "Percentage value to seek to" },
++ { "$ref": "Player.Position.Time", "required": true, "description": "Time to seek to" },
++ { "type": "string", "enum": [ "smallforward", "smallbackward", "bigforward", "bigbackward" ], "required": true, "description": "Seek by predefined jumps" },
+ { "type": "object", "properties": { "percentage": { "$ref": "Player.Position.Percentage", "required": true, "description": "Percentage value to seek to" } }, "additionalProperties": false, "required": true },
+ { "type": "object", "properties": { "time": { "$ref": "Player.Position.Time", "required": true, "description": "Time to seek to" } }, "additionalProperties": false, "required": true },
+ { "type": "object", "properties": { "step": { "type": "string", "enum": [ "smallforward", "smallbackward", "bigforward", "bigbackward" ], "required": true, "description": "Seek by predefined jumps" } }, "additionalProperties": false, "required": true },
+--
+2.30.0
+