diff options
author | Jonathan Marshall <jmarshall@never.you.mind> | 2012-11-02 22:45:45 +1300 |
---|---|---|
committer | Jonathan Marshall <jmarshall@never.you.mind> | 2012-11-26 20:44:05 +1300 |
commit | 73a9b08f264c859434b8e1ed650a57e606a4f3a7 (patch) | |
tree | 89374dbae6b78d7cda19c0704f6ca1e5d0baeb89 | |
parent | 3f271be2e81aa40ef8d9c2bca3132b1fa3216840 (diff) |
[JSON-RPC] switch to an integer (in seconds) for runtime
-rw-r--r-- | xbmc/interfaces/json-rpc/ServiceDescription.h | 8 | ||||
-rw-r--r-- | xbmc/interfaces/json-rpc/VideoLibrary.cpp | 2 | ||||
-rw-r--r-- | xbmc/interfaces/json-rpc/methods.json | 6 | ||||
-rw-r--r-- | xbmc/interfaces/json-rpc/types.json | 2 | ||||
-rw-r--r-- | xbmc/video/VideoInfoTag.cpp | 2 |
5 files changed, 10 insertions, 10 deletions
diff --git a/xbmc/interfaces/json-rpc/ServiceDescription.h b/xbmc/interfaces/json-rpc/ServiceDescription.h index e0149c820d..7de62d6f72 100644 --- a/xbmc/interfaces/json-rpc/ServiceDescription.h +++ b/xbmc/interfaces/json-rpc/ServiceDescription.h @@ -642,7 +642,7 @@ namespace JSONRPC "\"Video.Details.File\": {" "\"extends\": \"Video.Details.Item\"," "\"properties\": {" - "\"runtime\": { \"type\": \"string\" }," + "\"runtime\": { \"type\": \"integer\" }," "\"director\": { \"$ref\": \"Array.String\" }," "\"streamdetails\": { \"$ref\": \"Video.Streams\" }," "\"resume\": { \"$ref\": \"Video.Resume\" }" @@ -2473,7 +2473,7 @@ namespace JSONRPC "{ \"name\": \"movieid\", \"$ref\": \"Library.Id\", \"required\": true }," "{ \"name\": \"title\", \"$ref\": \"Optional.String\" }," "{ \"name\": \"playcount\", \"$ref\": \"Optional.Integer\" }," - "{ \"name\": \"runtime\", \"$ref\": \"Optional.String\" }," + "{ \"name\": \"runtime\", \"$ref\": \"Optional.Integer\" }," "{ \"name\": \"director\", \"type\": [ \"null\", { \"$ref\": \"Array.String\", \"required\": true } ], \"default\": null }," "{ \"name\": \"studio\", \"type\": [ \"null\", { \"$ref\": \"Array.String\", \"required\": true } ], \"default\": null }," "{ \"name\": \"year\", \"$ref\": \"Optional.Integer\" }," @@ -2538,7 +2538,7 @@ namespace JSONRPC "{ \"name\": \"episodeid\", \"$ref\": \"Library.Id\", \"required\": true }," "{ \"name\": \"title\", \"$ref\": \"Optional.String\" }," "{ \"name\": \"playcount\", \"$ref\": \"Optional.Integer\" }," - "{ \"name\": \"runtime\", \"$ref\": \"Optional.String\" }," + "{ \"name\": \"runtime\", \"$ref\": \"Optional.Integer\" }," "{ \"name\": \"director\", \"type\": [ \"null\", { \"$ref\": \"Array.String\", \"required\": true } ], \"default\": null }," "{ \"name\": \"plot\", \"$ref\": \"Optional.String\" }," "{ \"name\": \"rating\", \"$ref\": \"Optional.Number\" }," @@ -2565,7 +2565,7 @@ namespace JSONRPC "{ \"name\": \"musicvideoid\", \"$ref\": \"Library.Id\", \"required\": true }," "{ \"name\": \"title\", \"$ref\": \"Optional.String\" }," "{ \"name\": \"playcount\", \"$ref\": \"Optional.Integer\" }," - "{ \"name\": \"runtime\", \"$ref\": \"Optional.String\" }," + "{ \"name\": \"runtime\", \"$ref\": \"Optional.Integer\" }," "{ \"name\": \"director\", \"type\": [ \"null\", { \"$ref\": \"Array.String\", \"required\": true } ], \"default\": null }," "{ \"name\": \"studio\", \"type\": [ \"null\", { \"$ref\": \"Array.String\", \"required\": true } ], \"default\": null }," "{ \"name\": \"year\", \"$ref\": \"Optional.Integer\" }," diff --git a/xbmc/interfaces/json-rpc/VideoLibrary.cpp b/xbmc/interfaces/json-rpc/VideoLibrary.cpp index b55d90c543..705889bf1c 100644 --- a/xbmc/interfaces/json-rpc/VideoLibrary.cpp +++ b/xbmc/interfaces/json-rpc/VideoLibrary.cpp @@ -889,7 +889,7 @@ void CVideoLibrary::UpdateVideoTag(const CVariant ¶meterObject, CVideoInfoTa if (ParameterNotNull(parameterObject, "playcount")) details.m_playCount = (int)parameterObject["playcount"].asInteger(); if (ParameterNotNull(parameterObject, "runtime")) - details.m_duration = CVideoInfoTag::GetDurationFromMinuteString(parameterObject["runtime"].asString()); + details.m_duration = (int)parameterObject["runtime"].asInteger(); if (ParameterNotNull(parameterObject, "director")) CopyStringArray(parameterObject["director"], details.m_director); if (ParameterNotNull(parameterObject, "studio")) diff --git a/xbmc/interfaces/json-rpc/methods.json b/xbmc/interfaces/json-rpc/methods.json index 4f8fa4e848..057e06c60a 100644 --- a/xbmc/interfaces/json-rpc/methods.json +++ b/xbmc/interfaces/json-rpc/methods.json @@ -1244,7 +1244,7 @@ { "name": "movieid", "$ref": "Library.Id", "required": true }, { "name": "title", "$ref": "Optional.String" }, { "name": "playcount", "$ref": "Optional.Integer" }, - { "name": "runtime", "$ref": "Optional.String" }, + { "name": "runtime", "$ref": "Optional.Integer" }, { "name": "director", "type": [ "null", { "$ref": "Array.String", "required": true } ], "default": null }, { "name": "studio", "type": [ "null", { "$ref": "Array.String", "required": true } ], "default": null }, { "name": "year", "$ref": "Optional.Integer" }, @@ -1309,7 +1309,7 @@ { "name": "episodeid", "$ref": "Library.Id", "required": true }, { "name": "title", "$ref": "Optional.String" }, { "name": "playcount", "$ref": "Optional.Integer" }, - { "name": "runtime", "$ref": "Optional.String" }, + { "name": "runtime", "$ref": "Optional.Integer" }, { "name": "director", "type": [ "null", { "$ref": "Array.String", "required": true } ], "default": null }, { "name": "plot", "$ref": "Optional.String" }, { "name": "rating", "$ref": "Optional.Number" }, @@ -1336,7 +1336,7 @@ { "name": "musicvideoid", "$ref": "Library.Id", "required": true }, { "name": "title", "$ref": "Optional.String" }, { "name": "playcount", "$ref": "Optional.Integer" }, - { "name": "runtime", "$ref": "Optional.String" }, + { "name": "runtime", "$ref": "Optional.Integer" }, { "name": "director", "type": [ "null", { "$ref": "Array.String", "required": true } ], "default": null }, { "name": "studio", "type": [ "null", { "$ref": "Array.String", "required": true } ], "default": null }, { "name": "year", "$ref": "Optional.Integer" }, diff --git a/xbmc/interfaces/json-rpc/types.json b/xbmc/interfaces/json-rpc/types.json index 612f6d7c77..f80bce9bba 100644 --- a/xbmc/interfaces/json-rpc/types.json +++ b/xbmc/interfaces/json-rpc/types.json @@ -615,7 +615,7 @@ "Video.Details.File": { "extends": "Video.Details.Item", "properties": { - "runtime": { "type": "string" }, + "runtime": { "type": "integer" }, "director": { "$ref": "Array.String" }, "streamdetails": { "$ref": "Video.Streams" }, "resume": { "$ref": "Video.Resume" } diff --git a/xbmc/video/VideoInfoTag.cpp b/xbmc/video/VideoInfoTag.cpp index 96aab37137..0b6f71636b 100644 --- a/xbmc/video/VideoInfoTag.cpp +++ b/xbmc/video/VideoInfoTag.cpp @@ -446,7 +446,7 @@ void CVideoInfoTag::Serialize(CVariant& value) const value["set"] = m_strSet; value["setid"] = m_iSetId; value["tag"] = m_tags; - value["runtime"] = StringUtils::Format("%i", GetDuration() / 60); + value["runtime"] = GetDuration(); value["file"] = m_strFile; value["path"] = m_strPath; value["imdbnumber"] = m_strIMDBNumber; |