本文整理汇总了C++中CVideoDbUrl::HasOption方法的典型用法代码示例。如果您正苦于以下问题:C++ CVideoDbUrl::HasOption方法的具体用法?C++ CVideoDbUrl::HasOption怎么用?C++ CVideoDbUrl::HasOption使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CVideoDbUrl
的用法示例。
在下文中一共展示了CVideoDbUrl::HasOption方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetEpisodes
JSONRPC_STATUS CVideoLibrary::GetEpisodes(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CVideoDatabase videodatabase;
if (!videodatabase.Open())
return InternalError;
SortDescription sorting;
ParseLimits(parameterObject, sorting.limitStart, sorting.limitEnd);
if (!ParseSorting(parameterObject, sorting.sortBy, sorting.sortOrder, sorting.sortAttributes))
return InvalidParams;
int tvshowID = (int)parameterObject["tvshowid"].asInteger();
int season = (int)parameterObject["season"].asInteger();
std::string strPath = StringUtils::Format("videodb://tvshows/titles/%i/%i/", tvshowID, season);
CVideoDbUrl videoUrl;
if (!videoUrl.FromString(strPath))
return InternalError;
const CVariant &filter = parameterObject["filter"];
if (filter.isMember("genreid"))
videoUrl.AddOption("genreid", (int)filter["genreid"].asInteger());
else if (filter.isMember("genre"))
videoUrl.AddOption("genre", filter["genre"].asString());
else if (filter.isMember("year"))
videoUrl.AddOption("year", (int)filter["year"].asInteger());
else if (filter.isMember("actor"))
videoUrl.AddOption("actor", filter["actor"].asString());
else if (filter.isMember("director"))
videoUrl.AddOption("director", filter["director"].asString());
else if (filter.isObject())
{
std::string xsp;
if (!GetXspFiltering("episodes", filter, xsp))
return InvalidParams;
videoUrl.AddOption("xsp", xsp);
}
if (tvshowID <= 0 && (season > 0 || videoUrl.HasOption("genreid") || videoUrl.HasOption("genre") || videoUrl.HasOption("actor")))
return InvalidParams;
if (tvshowID > 0)
{
videoUrl.AddOption("tvshowid", tvshowID);
if (season >= 0)
videoUrl.AddOption("season", season);
}
CFileItemList items;
if (!videodatabase.GetEpisodesByWhere(videoUrl.ToString(), CDatabase::Filter(), items, false, sorting, RequiresAdditionalDetails(MediaTypeEpisode, parameterObject)))
return InvalidParams;
return HandleItems("episodeid", "episodes", items, parameterObject, result, false);
}