public async Task <IEnumerable <ChannelItemInfo> > Search(ChannelSearchInfo searchInfo, Controller.Entities.User user, CancellationToken cancellationToken) { var downloader = new VimeoListingDownloader(_logger, _jsonSerializer, _httpClient); var search = await downloader.GetSearchVimeoList(searchInfo.SearchTerm, cancellationToken); return(search.Select(i => new ChannelItemInfo { ContentType = ChannelMediaContentType.Clip, ImageUrl = i.thumbnails[0].Url, IsInfiniteStream = false, MediaType = ChannelMediaType.Video, Name = i.title, Overview = i.description, Type = ChannelItemType.Media, Id = i.urls[0].Value.GetMD5().ToString("N"), MediaSources = new List <ChannelMediaInfo> { new ChannelMediaInfo { Path = i.urls[0].Value, Height = i.height, Width = i.width } } })); }
public static User GetUser(Controller.Entities.User user) { return(Plugin.Instance.PluginConfiguration.Users != null?Plugin.Instance.PluginConfiguration.Users.FirstOrDefault(tUser => new Guid(tUser.LinkedMbUserId).Equals(user.Id)) : null); }