本文整理汇总了C#中RssLink.SetTrackId方法的典型用法代码示例。如果您正苦于以下问题:C# RssLink.SetTrackId方法的具体用法?C# RssLink.SetTrackId怎么用?C# RssLink.SetTrackId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RssLink
的用法示例。
在下文中一共展示了RssLink.SetTrackId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DiscoverNextPageCategories
public override int DiscoverNextPageCategories(NextPageCategory nextPagecategory)
{
nextPagecategory.ParentCategory.SubCategories.Remove(nextPagecategory);
string index = nextPagecategory.GetStartIndex();
int iIndex = 0;
int.TryParse(index, out iIndex);
string url = nextPagecategory.Url;
url = url.Replace("START_INDEX", index);
url = url.Replace("STOP_INDEX", (iIndex + 50 - 1).ToString());
string data = MyGetWebData(url);
JObject json = (JObject)JsonConvert.DeserializeObject(data);
int i = 0;
foreach (JObject item in json["catalogItems"])
{
RssLink cat = new RssLink()
{
Name = (string)item["title"],
Url = ((int)item["titleId"]).ToString(),
Thumb = (string)item["boxart"],
ParentCategory = nextPagecategory.ParentCategory,
HasSubCategories = true,
Description = enableDesc && enableDescInListing ? GetTitleDescription(((int)item["titleId"]).ToString(), ((int)item["trackId"]).ToString()) : ""
};
cat.SetState(NetflixUtils.TitleState);
if (enableDesc || enableAddRemoveMylist)
cat.SetTrackId(((int)item["trackId"]).ToString());
i++;
nextPagecategory.ParentCategory.SubCategories.Add(cat);
}
if (i == 50)
{
NextPageCategory next = new NextPageCategory() { Url = nextPagecategory.Url, ParentCategory = nextPagecategory.ParentCategory };
next.SetState(NetflixUtils.TitleState);
next.SetStartIndex((iIndex + 50).ToString());
nextPagecategory.ParentCategory.SubCategories.Add(next);
}
return i;
}
示例2: Search
public override List<SearchResultItem> Search(string query, string category = null)
{
List<SearchResultItem> results = new List<SearchResultItem>();
string data = MyGetWebData(string.Format(searchUrl, apiRoot, HttpUtility.UrlEncode(query), MaxSearchResults));
JObject json = (JObject)JsonConvert.DeserializeObject(data);
JToken galery = json["galleryVideos"];
if (galery != null)
{
JToken items = galery["items"];
if (items != null)
{
foreach (JToken item in items)
{
RssLink cat = new RssLink() { Name = (string)item["title"], Url = ((int)item["id"]).ToString(), Thumb = (string)item["boxart"], HasSubCategories = true };
cat.SetState(NetflixUtils.TitleState);
if (enableDesc || enableAddRemoveMylist)
cat.SetTrackId(((int)item["trackId"]).ToString());
results.Add(cat);
}
}
}
return results;
}
示例3: DiscoverSubCategories
//.........这里部分代码省略.........
if (!parentCategory.SubCategories.Any(c => (c as RssLink).Url == url))
{
RssLink category = new RssLink()
{
Name = a.InnerText.Trim(),
Url = a.GetAttributeValue("href", ""),
HasSubCategories = true,
ParentCategory = parentCategory
};
category.SetState(NetflixUtils.SinglePageCategoriesState);
parentCategory.SubCategories.Add(category);
}
}
}
#endregion
#region SinglePageCategories
else if (parentCategory.IsSinglePageCategoriesState())
{
foreach (NetflixData d in GetSinglePageNetflixData(parentCategory, enableAddRemoveMylist))
{
RssLink cat = new RssLink()
{
Name = d.Title,
Url = d.Id,
Thumb = d.Cover,
ParentCategory = parentCategory,
HasSubCategories = !(parentCategory.ParentCategory != null && parentCategory.ParentCategory.Name == "Characters"),
Description = d.Description
};
cat.SetState(NetflixUtils.TitleState);
if (!string.IsNullOrEmpty(d.TrackId))
cat.SetTrackId(d.TrackId);
parentCategory.SubCategories.Add(cat);
}
}
#endregion
#region MultiplePageCategories
else if (parentCategory.IsMultiplePageCategoriesState()) //This is browse categories
{
string url = (parentCategory as RssLink).Url;
string data = MyGetWebData(url);
SetShaktiApiAndBuildId(data);
Uri uri = new Uri(url);
string agid = HttpUtility.ParseQueryString(uri.Query).Get("agid");
if (!string.IsNullOrEmpty(ShaktiApi) && !string.IsNullOrEmpty(BuildId) && !string.IsNullOrEmpty(agid))
{
data = MyGetWebData(string.Format(genreUrl, ShaktiApi, BuildId, agid, 0, 50, BrowseSort));
JObject json = (JObject)JsonConvert.DeserializeObject(data);
foreach (JObject item in json["catalogItems"])
{
RssLink category = new RssLink()
{
Name = (string)item["title"],
Url = ((int)item["titleId"]).ToString(),
Thumb = (string)item["boxart"],
ParentCategory = parentCategory,
HasSubCategories = true,
Description = enableDesc && enableDescInListing ? GetTitleDescription(((int)item["titleId"]).ToString(), ((int)item["trackId"]).ToString()) : ""
};
category.SetState(NetflixUtils.TitleState);
if (enableDesc || enableAddRemoveMylist)
category.SetTrackId(((int)item["trackId"]).ToString());
parentCategory.SubCategories.Add(category);