本文整理汇总了C#中IProvider.ConstructUnsortUrl方法的典型用法代码示例。如果您正苦于以下问题:C# IProvider.ConstructUnsortUrl方法的具体用法?C# IProvider.ConstructUnsortUrl怎么用?C# IProvider.ConstructUnsortUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IProvider
的用法示例。
在下文中一共展示了IProvider.ConstructUnsortUrl方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetFilters
public MediaContainer GetFilters(IProvider prov, string uid)
{
int t = 0;
int.TryParse(uid, out t);
JMMUser user = t > 0 ? Helper.GetJMMUser(uid) : Helper.GetUser(uid);
if (user == null)
return new MediaContainer() { ErrorString = "User not found" };
int userid = user.JMMUserID;
BreadCrumbs info = prov.UseBreadCrumbs
? new BreadCrumbs { Key = prov.ConstructFiltersUrl(userid), Title = "Anime" }
: null;
BaseObject ret =
new BaseObject(prov.NewMediaContainer(MediaContainerTypes.Show, "Anime", false, false, info));
if (!ret.Init())
return new MediaContainer(); //Normal OPTION VERB
List<Video> dirs = new List<Video>();
try
{
using (var session = DatabaseFactory.SessionFactory.OpenSession())
{
List<GroupFilter> allGfs = RepoFactory.GroupFilter.GetTopLevel().Where(a => a.InvisibleInClients == 0 &&
(
(a.GroupsIds.ContainsKey(userid) && a.GroupsIds[userid].Count > 0)
|| (a.FilterType & (int)GroupFilterType.Directory) == (int)GroupFilterType.Directory)
).ToList();
foreach (GroupFilter gg in allGfs)
{
Directory pp = Helper.DirectoryFromFilter(prov, gg, userid);
if (pp != null)
dirs.Add(prov, pp, info);
}
List<VideoLocal> vids = RepoFactory.VideoLocal.GetVideosWithoutEpisode();
if (vids.Count > 0)
{
Directory pp = new Directory() { Type = "show" };
pp.Key = prov.ShortUrl(prov.ConstructUnsortUrl(userid));
pp.Title = "Unsort";
pp.AnimeType = JMMContracts.PlexAndKodi.AnimeTypes.AnimeUnsort.ToString();
pp.Thumb = Helper.ConstructSupportImageLink("plex_unsort.png");
pp.LeafCount = vids.Count.ToString();
pp.ViewedLeafCount = "0";
dirs.Add(prov, pp, info);
}
var playlists = RepoFactory.Playlist.GetAll();
if (playlists.Count > 0)
{
Directory pp = new Directory() { Type = "show" };
pp.Key = prov.ShortUrl(prov.ConstructPlaylistUrl(userid));
pp.Title = "Playlists";
pp.AnimeType = JMMContracts.PlexAndKodi.AnimeTypes.AnimePlaylist.ToString();
pp.Thumb = Helper.ConstructSupportImageLink("plex_playlists.png");
pp.LeafCount = playlists.Count.ToString();
pp.ViewedLeafCount = "0";
dirs.Add(prov, pp, info);
}
dirs = dirs.OrderBy(a => a.Title).ToList();
}
ret.MediaContainer.RandomizeArt(dirs);
ret.Childrens = dirs;
ret.MediaContainer.Size = (int.Parse(ret.MediaContainer.Size) + prov.AddExtraItemForSearchButtonInGroupFilters).ToString();
return ret.GetStream(prov);
}
catch (Exception ex)
{
logger.Error( ex,ex.ToString());
return new MediaContainer() { ErrorString = "System Error, see JMMServer logs for more information" };
}
}