Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #1233 from koying/streamdetails

json-rpc: fix streamdetails never being retrieved
  • Loading branch information...
commit 839738a73aff7f40f1a282056fec926f8499302a 2 parents 1c7791d + b346ecf
Sascha Montellese Montellese authored
Showing with 61 additions and 7 deletions.
  1. +61 −7 xbmc/interfaces/json-rpc/VideoLibrary.cpp
68 xbmc/interfaces/json-rpc/VideoLibrary.cpp
View
@@ -53,6 +53,16 @@ JSONRPC_STATUS CVideoLibrary::GetMovieDetails(const CStdString &method, ITranspo
if (!videodatabase.GetMovieInfo("", infos, id) || infos.m_iDbId <= 0)
return InvalidParams;
+ for (CVariant::const_iterator_array itr = parameterObject["properties"].begin_array(); itr != parameterObject["properties"].end_array(); itr++)
+ {
+ CStdString fieldValue = itr->asString();
+ if (fieldValue == "streamdetails")
+ {
+ videodatabase.GetStreamDetails(infos);
+ break;
+ }
+ }
+
HandleFileItem("movieid", true, "moviedetails", CFileItemPtr(new CFileItem(infos)), parameterObject, parameterObject["properties"], result, false);
return OK;
}
@@ -196,6 +206,16 @@ JSONRPC_STATUS CVideoLibrary::GetEpisodeDetails(const CStdString &method, ITrans
if (!videodatabase.GetEpisodeInfo("", infos, id) || infos.m_iDbId <= 0)
return InvalidParams;
+ for (CVariant::const_iterator_array itr = parameterObject["properties"].begin_array(); itr != parameterObject["properties"].end_array(); itr++)
+ {
+ CStdString fieldValue = itr->asString();
+ if (fieldValue == "streamdetails")
+ {
+ videodatabase.GetStreamDetails(infos);
+ break;
+ }
+ }
+
CFileItemPtr pItem = CFileItemPtr(new CFileItem(infos));
// We need to set the correct base path to get the valid fanart
int tvshowid = infos.m_iIdShow;
@@ -242,6 +262,16 @@ JSONRPC_STATUS CVideoLibrary::GetMusicVideoDetails(const CStdString &method, ITr
if (!videodatabase.GetMusicVideoInfo("", infos, id) || infos.m_iDbId <= 0)
return InvalidParams;
+ for (CVariant::const_iterator_array itr = parameterObject["properties"].begin_array(); itr != parameterObject["properties"].end_array(); itr++)
+ {
+ CStdString fieldValue = itr->asString();
+ if (fieldValue == "streamdetails")
+ {
+ videodatabase.GetStreamDetails(infos);
+ break;
+ }
+ }
+
HandleFileItem("musicvideoid", true, "musicvideodetails", CFileItemPtr(new CFileItem(infos)), parameterObject, parameterObject["properties"], result, false);
return OK;
}
@@ -616,17 +646,25 @@ JSONRPC_STATUS CVideoLibrary::GetAdditionalMovieDetails(const CVariant &paramete
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 == "cast" || fieldValue == "set" || fieldValue == "setid" || fieldValue == "showlink" || fieldValue == "resume")
additionalInfo = true;
+ else if (fieldValue == "streamdetails")
+ streamdetails = true;
}
- if (additionalInfo)
+ if (additionalInfo || streamdetails)
{
for (int index = 0; index < items.Size(); index++)
- videodatabase.GetMovieInfo("", *(items[index]->GetVideoInfoTag()), items[index]->GetVideoInfoTag()->m_iDbId);
+ {
+ if (additionalInfo)
+ videodatabase.GetMovieInfo("", *(items[index]->GetVideoInfoTag()), items[index]->GetVideoInfoTag()->m_iDbId);
+ if (streamdetails)
+ videodatabase.GetStreamDetails(*(items[index]->GetVideoInfoTag()));
+ }
}
int size = items.Size();
@@ -643,17 +681,25 @@ JSONRPC_STATUS CVideoLibrary::GetAdditionalEpisodeDetails(const CVariant &parame
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 == "cast" || fieldValue == "resume")
additionalInfo = true;
+ else if (fieldValue == "streamdetails")
+ streamdetails = true;
}
- if (additionalInfo)
+ if (additionalInfo || streamdetails)
{
for (int index = 0; index < items.Size(); index++)
- videodatabase.GetEpisodeInfo("", *(items[index]->GetVideoInfoTag()), items[index]->GetVideoInfoTag()->m_iDbId);
+ {
+ if (additionalInfo)
+ videodatabase.GetEpisodeInfo("", *(items[index]->GetVideoInfoTag()), items[index]->GetVideoInfoTag()->m_iDbId);
+ if (streamdetails)
+ videodatabase.GetStreamDetails(*(items[index]->GetVideoInfoTag()));
+ }
}
int size = items.Size();
@@ -670,19 +716,27 @@ JSONRPC_STATUS CVideoLibrary::GetAdditionalMusicVideoDetails(const CVariant &par
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")
+ streamdetails = true;
}
- if (additionalInfo)
+ if (additionalInfo || streamdetails)
{
for (int index = 0; index < items.Size(); index++)
- videodatabase.GetMusicVideoInfo("", *(items[index]->GetVideoInfoTag()), items[index]->GetVideoInfoTag()->m_iDbId);
+ {
+ if (additionalInfo)
+ videodatabase.GetMusicVideoInfo("", *(items[index]->GetVideoInfoTag()), items[index]->GetVideoInfoTag()->m_iDbId);
+ if (streamdetails)
+ videodatabase.GetStreamDetails(*(items[index]->GetVideoInfoTag()));
+ }
}
-
+
int size = items.Size();
if (items.HasProperty("total") && items.GetProperty("total").asInteger() > size)
size = (int)items.GetProperty("total").asInteger();
Please sign in to comment.
Something went wrong with that request. Please try again.