diff options
author | montellese <montellese@xbmc.org> | 2012-09-24 18:27:55 +0200 |
---|---|---|
committer | montellese <montellese@xbmc.org> | 2012-09-24 18:28:17 +0200 |
commit | 34f08756f913db8d7934f40b89537eaaecde13a3 (patch) | |
tree | 062319f7ae47700f3e18dcb67af37555a2897161 | |
parent | 326dd2874bc1ea2ace6f4fc4387b6d0a291d861f (diff) |
jsonrpc: don't retrieve video details for every item when the "resume" property is requested
-rw-r--r-- | xbmc/interfaces/json-rpc/ServiceDescription.h | 5 | ||||
-rw-r--r-- | xbmc/interfaces/json-rpc/VideoLibrary.cpp | 19 | ||||
-rw-r--r-- | xbmc/interfaces/json-rpc/types.json | 5 |
3 files changed, 9 insertions, 20 deletions
diff --git a/xbmc/interfaces/json-rpc/ServiceDescription.h b/xbmc/interfaces/json-rpc/ServiceDescription.h index 98c6a5b39c..e44712a5d5 100644 --- a/xbmc/interfaces/json-rpc/ServiceDescription.h +++ b/xbmc/interfaces/json-rpc/ServiceDescription.h @@ -429,7 +429,7 @@ namespace JSONRPC "\"Video.Fields.Movie\": {" "\"extends\": \"Item.Fields.Base\"," "\"items\": { \"type\": \"string\"," - "\"description\": \"Requesting the cast, showlink and/or resume field will result in increased response times\"," + "\"description\": \"Requesting the cast, showlink and/or tag field will result in increased response times\"," "\"enum\": [ \"title\", \"genre\", \"year\", \"rating\", \"director\", \"trailer\"," "\"tagline\", \"plot\", \"plotoutline\", \"originaltitle\", \"lastplayed\"," "\"playcount\", \"writer\", \"studio\", \"mpaa\", \"cast\", \"country\"," @@ -466,7 +466,7 @@ namespace JSONRPC "\"Video.Fields.Episode\": {" "\"extends\": \"Item.Fields.Base\"," "\"items\": { \"type\": \"string\"," - "\"description\": \"Requesting the cast and/or resume field will result in increased response times\"," + "\"description\": \"Requesting the cast field will result in increased response times\"," "\"enum\": [ \"title\", \"plot\", \"votes\", \"rating\", \"writer\"," "\"firstaired\", \"playcount\", \"runtime\", \"director\"," "\"productioncode\", \"season\", \"episode\", \"originaltitle\"," @@ -477,7 +477,6 @@ namespace JSONRPC "\"Video.Fields.MusicVideo\": {" "\"extends\": \"Item.Fields.Base\"," "\"items\": { \"type\": \"string\"," - "\"description\": \"Requesting the resume field will result in increased response times\"," "\"enum\": [ \"title\", \"playcount\", \"runtime\", \"director\"," "\"studio\", \"year\", \"plot\", \"album\", \"artist\"," "\"genre\", \"track\", \"streamdetails\", \"lastplayed\"," diff --git a/xbmc/interfaces/json-rpc/VideoLibrary.cpp b/xbmc/interfaces/json-rpc/VideoLibrary.cpp index a2d402b112..c667f38765 100644 --- a/xbmc/interfaces/json-rpc/VideoLibrary.cpp +++ b/xbmc/interfaces/json-rpc/VideoLibrary.cpp @@ -760,7 +760,7 @@ JSONRPC_STATUS CVideoLibrary::GetAdditionalMovieDetails(const CVariant ¶mete for (CVariant::const_iterator_array itr = parameterObject["properties"].begin_array(); itr != parameterObject["properties"].end_array(); itr++) { CStdString fieldValue = itr->asString(); - if (fieldValue == "cast" || fieldValue == "set" || fieldValue == "setid" || fieldValue == "showlink" || fieldValue == "resume" || fieldValue == "tag") + if (fieldValue == "cast" || fieldValue == "showlink" || fieldValue == "tag") additionalInfo = true; else if (fieldValue == "streamdetails") streamdetails = true; @@ -795,7 +795,7 @@ JSONRPC_STATUS CVideoLibrary::GetAdditionalEpisodeDetails(const CVariant ¶me for (CVariant::const_iterator_array itr = parameterObject["properties"].begin_array(); itr != parameterObject["properties"].end_array(); itr++) { CStdString fieldValue = itr->asString(); - if (fieldValue == "cast" || fieldValue == "resume") + if (fieldValue == "cast") additionalInfo = true; else if (fieldValue == "streamdetails") streamdetails = true; @@ -825,26 +825,17 @@ JSONRPC_STATUS CVideoLibrary::GetAdditionalMusicVideoDetails(const CVariant &par if (!videodatabase.Open()) return InternalError; - bool additionalInfo = false; bool streamdetails = false; for (CVariant::const_iterator_array itr = parameterObject["properties"].begin_array(); itr != parameterObject["properties"].end_array(); itr++) { - CStdString fieldValue = itr->asString(); - if (fieldValue == "resume") - additionalInfo = true; - else if (fieldValue == "streamdetails") + if (itr->asString() == "streamdetails") streamdetails = true; } - if (additionalInfo || streamdetails) + if (streamdetails) { for (int index = 0; index < items.Size(); index++) - { - if (additionalInfo) - videodatabase.GetMusicVideoInfo("", *(items[index]->GetVideoInfoTag()), items[index]->GetVideoInfoTag()->m_iDbId); - if (streamdetails) - videodatabase.GetStreamDetails(*(items[index]->GetVideoInfoTag())); - } + videodatabase.GetStreamDetails(*(items[index]->GetVideoInfoTag())); } int size = items.Size(); diff --git a/xbmc/interfaces/json-rpc/types.json b/xbmc/interfaces/json-rpc/types.json index b849a38a4e..9bfbab7f8c 100644 --- a/xbmc/interfaces/json-rpc/types.json +++ b/xbmc/interfaces/json-rpc/types.json @@ -402,7 +402,7 @@ "Video.Fields.Movie": { "extends": "Item.Fields.Base", "items": { "type": "string", - "description": "Requesting the cast, showlink and/or resume field will result in increased response times", + "description": "Requesting the cast, showlink and/or tag field will result in increased response times", "enum": [ "title", "genre", "year", "rating", "director", "trailer", "tagline", "plot", "plotoutline", "originaltitle", "lastplayed", "playcount", "writer", "studio", "mpaa", "cast", "country", @@ -439,7 +439,7 @@ "Video.Fields.Episode": { "extends": "Item.Fields.Base", "items": { "type": "string", - "description": "Requesting the cast and/or resume field will result in increased response times", + "description": "Requesting the cast field will result in increased response times", "enum": [ "title", "plot", "votes", "rating", "writer", "firstaired", "playcount", "runtime", "director", "productioncode", "season", "episode", "originaltitle", @@ -450,7 +450,6 @@ "Video.Fields.MusicVideo": { "extends": "Item.Fields.Base", "items": { "type": "string", - "description": "Requesting the resume field will result in increased response times", "enum": [ "title", "playcount", "runtime", "director", "studio", "year", "plot", "album", "artist", "genre", "track", "streamdetails", "lastplayed", |