Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

FIX: [JSON] streamdetails are never retrieved

  • Loading branch information...
commit b346ecffcc013578fb38fe9269ce41535868745d 1 parent 22e12a7
Chris Browet authored

Showing 1 changed file with 61 additions and 7 deletions. Show diff stats Hide diff stats

  1. +61 7 xbmc/interfaces/json-rpc/VideoLibrary.cpp
68 xbmc/interfaces/json-rpc/VideoLibrary.cpp
@@ -53,6 +53,16 @@ JSONRPC_STATUS CVideoLibrary::GetMovieDetails(const CStdString &method, ITranspo
53 53 if (!videodatabase.GetMovieInfo("", infos, id) || infos.m_iDbId <= 0)
54 54 return InvalidParams;
55 55
  56 + for (CVariant::const_iterator_array itr = parameterObject["properties"].begin_array(); itr != parameterObject["properties"].end_array(); itr++)
  57 + {
  58 + CStdString fieldValue = itr->asString();
  59 + if (fieldValue == "streamdetails")
  60 + {
  61 + videodatabase.GetStreamDetails(infos);
  62 + break;
  63 + }
  64 + }
  65 +
56 66 HandleFileItem("movieid", true, "moviedetails", CFileItemPtr(new CFileItem(infos)), parameterObject, parameterObject["properties"], result, false);
57 67 return OK;
58 68 }
@@ -196,6 +206,16 @@ JSONRPC_STATUS CVideoLibrary::GetEpisodeDetails(const CStdString &method, ITrans
196 206 if (!videodatabase.GetEpisodeInfo("", infos, id) || infos.m_iDbId <= 0)
197 207 return InvalidParams;
198 208
  209 + for (CVariant::const_iterator_array itr = parameterObject["properties"].begin_array(); itr != parameterObject["properties"].end_array(); itr++)
  210 + {
  211 + CStdString fieldValue = itr->asString();
  212 + if (fieldValue == "streamdetails")
  213 + {
  214 + videodatabase.GetStreamDetails(infos);
  215 + break;
  216 + }
  217 + }
  218 +
199 219 CFileItemPtr pItem = CFileItemPtr(new CFileItem(infos));
200 220 // We need to set the correct base path to get the valid fanart
201 221 int tvshowid = infos.m_iIdShow;
@@ -242,6 +262,16 @@ JSONRPC_STATUS CVideoLibrary::GetMusicVideoDetails(const CStdString &method, ITr
242 262 if (!videodatabase.GetMusicVideoInfo("", infos, id) || infos.m_iDbId <= 0)
243 263 return InvalidParams;
244 264
  265 + for (CVariant::const_iterator_array itr = parameterObject["properties"].begin_array(); itr != parameterObject["properties"].end_array(); itr++)
  266 + {
  267 + CStdString fieldValue = itr->asString();
  268 + if (fieldValue == "streamdetails")
  269 + {
  270 + videodatabase.GetStreamDetails(infos);
  271 + break;
  272 + }
  273 + }
  274 +
245 275 HandleFileItem("musicvideoid", true, "musicvideodetails", CFileItemPtr(new CFileItem(infos)), parameterObject, parameterObject["properties"], result, false);
246 276 return OK;
247 277 }
@@ -616,17 +646,25 @@ JSONRPC_STATUS CVideoLibrary::GetAdditionalMovieDetails(const CVariant &paramete
616 646 return InternalError;
617 647
618 648 bool additionalInfo = false;
  649 + bool streamdetails = false;
619 650 for (CVariant::const_iterator_array itr = parameterObject["properties"].begin_array(); itr != parameterObject["properties"].end_array(); itr++)
620 651 {
621 652 CStdString fieldValue = itr->asString();
622 653 if (fieldValue == "cast" || fieldValue == "set" || fieldValue == "setid" || fieldValue == "showlink" || fieldValue == "resume")
623 654 additionalInfo = true;
  655 + else if (fieldValue == "streamdetails")
  656 + streamdetails = true;
624 657 }
625 658
626   - if (additionalInfo)
  659 + if (additionalInfo || streamdetails)
627 660 {
628 661 for (int index = 0; index < items.Size(); index++)
629   - videodatabase.GetMovieInfo("", *(items[index]->GetVideoInfoTag()), items[index]->GetVideoInfoTag()->m_iDbId);
  662 + {
  663 + if (additionalInfo)
  664 + videodatabase.GetMovieInfo("", *(items[index]->GetVideoInfoTag()), items[index]->GetVideoInfoTag()->m_iDbId);
  665 + if (streamdetails)
  666 + videodatabase.GetStreamDetails(*(items[index]->GetVideoInfoTag()));
  667 + }
630 668 }
631 669
632 670 int size = items.Size();
@@ -643,17 +681,25 @@ JSONRPC_STATUS CVideoLibrary::GetAdditionalEpisodeDetails(const CVariant &parame
643 681 return InternalError;
644 682
645 683 bool additionalInfo = false;
  684 + bool streamdetails = false;
646 685 for (CVariant::const_iterator_array itr = parameterObject["properties"].begin_array(); itr != parameterObject["properties"].end_array(); itr++)
647 686 {
648 687 CStdString fieldValue = itr->asString();
649 688 if (fieldValue == "cast" || fieldValue == "resume")
650 689 additionalInfo = true;
  690 + else if (fieldValue == "streamdetails")
  691 + streamdetails = true;
651 692 }
652 693
653   - if (additionalInfo)
  694 + if (additionalInfo || streamdetails)
654 695 {
655 696 for (int index = 0; index < items.Size(); index++)
656   - videodatabase.GetEpisodeInfo("", *(items[index]->GetVideoInfoTag()), items[index]->GetVideoInfoTag()->m_iDbId);
  697 + {
  698 + if (additionalInfo)
  699 + videodatabase.GetEpisodeInfo("", *(items[index]->GetVideoInfoTag()), items[index]->GetVideoInfoTag()->m_iDbId);
  700 + if (streamdetails)
  701 + videodatabase.GetStreamDetails(*(items[index]->GetVideoInfoTag()));
  702 + }
657 703 }
658 704
659 705 int size = items.Size();
@@ -670,19 +716,27 @@ JSONRPC_STATUS CVideoLibrary::GetAdditionalMusicVideoDetails(const CVariant &par
670 716 return InternalError;
671 717
672 718 bool additionalInfo = false;
  719 + bool streamdetails = false;
673 720 for (CVariant::const_iterator_array itr = parameterObject["properties"].begin_array(); itr != parameterObject["properties"].end_array(); itr++)
674 721 {
675 722 CStdString fieldValue = itr->asString();
676 723 if (fieldValue == "resume")
677 724 additionalInfo = true;
  725 + else if (fieldValue == "streamdetails")
  726 + streamdetails = true;
678 727 }
679 728
680   - if (additionalInfo)
  729 + if (additionalInfo || streamdetails)
681 730 {
682 731 for (int index = 0; index < items.Size(); index++)
683   - videodatabase.GetMusicVideoInfo("", *(items[index]->GetVideoInfoTag()), items[index]->GetVideoInfoTag()->m_iDbId);
  732 + {
  733 + if (additionalInfo)
  734 + videodatabase.GetMusicVideoInfo("", *(items[index]->GetVideoInfoTag()), items[index]->GetVideoInfoTag()->m_iDbId);
  735 + if (streamdetails)
  736 + videodatabase.GetStreamDetails(*(items[index]->GetVideoInfoTag()));
  737 + }
684 738 }
685   -
  739 +
686 740 int size = items.Size();
687 741 if (items.HasProperty("total") && items.GetProperty("total").asInteger() > size)
688 742 size = (int)items.GetProperty("total").asInteger();

0 comments on commit b346ecf

Please sign in to comment.
Something went wrong with that request. Please try again.