public async Task<IEnumerable<ChannelItemInfo>> GetLatestMedia(ChannelLatestMediaSearch request, CancellationToken cancellationToken) { var items = new List<ChannelItemInfo>(); using (var site = await _httpClient.Get("https://api.vineapp.com/timelines/popular", CancellationToken.None).ConfigureAwait(false)) { var timelineList = _jsonSerializer.DeserializeFromStream<TimelineList>(site); foreach (var c in timelineList.data.records) { items.Add(new ChannelItemInfo { Name = c.description, Id = c.postId.ToString(), ImageUrl = c.thumbnailUrl, MediaType = ChannelMediaType.Video, ContentType = ChannelMediaContentType.Clip, Type = ChannelItemType.Media, DateCreated = DateTime.Parse(c.created), MediaSources = new List<ChannelMediaInfo> { new ChannelMediaInfo { Path = c.videoUrl, Container = Container.MP4 } } }); } } return items.OrderByDescending(i => i.DateCreated).ToList(); }
public async Task<IEnumerable<ChannelItemInfo>> GetLatestMedia(ChannelLatestMediaSearch request, CancellationToken cancellationToken) { return await GetVideoListing("video", "MostRecent", "nogenre", new InternalChannelItemQuery { Limit = 6 }, cancellationToken).ConfigureAwait(false); }
public async Task<IEnumerable<ChannelItemInfo>> GetLatestMedia(ChannelLatestMediaSearch request, CancellationToken cancellationToken) { return await GetChildren("latest", "/", cancellationToken).ConfigureAwait(false); }
public async Task<IEnumerable<ChannelItemInfo>> GetLatestMedia(ChannelLatestMediaSearch request, CancellationToken cancellationToken) { // Looks like the only way we can do this is by getting all, then sorting var all = await GetAllMedia(new InternalAllChannelMediaQuery { UserId = request.UserId }, cancellationToken).ConfigureAwait(false); return all.Items.OrderByDescending(i => i.DateCreated ?? DateTime.MinValue); }
public async Task<IEnumerable<ChannelItemInfo>> GetLatestMedia(ChannelLatestMediaSearch request, CancellationToken cancellationToken) { var downloader = new SoundCloudListingDownloader(_logger, _jsonSerializer, _httpClient); var songs = await downloader.GetTrackList(new InternalChannelItemQuery {FolderId = "latest", Limit = 6}, cancellationToken).ConfigureAwait(false); return songs.Select(i => new ChannelItemInfo { ContentType = ChannelMediaContentType.Song, ImageUrl = i.artwork_url, IsInfiniteStream = false, MediaType = ChannelMediaType.Audio, Name = i.title, Type = ChannelItemType.Media, Id = i.id.ToString(), RunTimeTicks = TimeSpan.FromMilliseconds(i.duration).Ticks, DateCreated = DateTime.Parse(i.created_at), MediaSources = new List<ChannelMediaInfo> { new ChannelMediaInfo { Path = i.stream_url + "?client_id=78fd88dde7ebf8fdcad08106f6d56ab6" } } }).OrderByDescending(i => i.DateCreated ?? DateTime.MinValue); }
public async Task<IEnumerable<ChannelItemInfo>> GetLatestMedia(ChannelLatestMediaSearch request, CancellationToken cancellationToken) { var result = await GetChannelItems(new InternalChannelItemQuery { SortBy = ChannelItemSortField.DateCreated, SortDescending = true, UserId = request.UserId, FolderId = ChannelMediaContentType.MovieExtra.ToString().ToLower() + "|" + ExtraType.Trailer + "|" + TrailerType.ComingSoonToTheaters }, cancellationToken).ConfigureAwait(false); return result.Items; }
public async Task<IEnumerable<ChannelItemInfo>> GetLatestMedia(ChannelLatestMediaSearch request, CancellationToken cancellationToken) { var downloader = new Revision3ListingDownloader(_logger, _jsonSerializer, _httpClient); var videos = await downloader.GetLatestEpisodeList(cancellationToken) .ConfigureAwait(false); return videos.episodes.Select(i => new ChannelItemInfo { ContentType = ChannelMediaContentType.Clip, ImageUrl = !String.IsNullOrEmpty(i.images.medium) ? i.images.medium : "", MediaType = ChannelMediaType.Video, Name = i.show.name + " - " + i.name, Type = ChannelItemType.Media, Id = i.video_id, RunTimeTicks = TimeSpan.FromSeconds(i.duration).Ticks, DateCreated = !String.IsNullOrEmpty(i.published) ? Convert.ToDateTime(i.published) : DateTime.MinValue, Overview = !String.IsNullOrEmpty(i.summary) ? i.summary : "" }).OrderByDescending(i => i.DateCreated); }
public async Task<IEnumerable<ChannelItemInfo>> GetLatestMedia(ChannelLatestMediaSearch request, CancellationToken cancellationToken) { var result = await GetChannelItems(new InternalChannelItemQuery { SortBy = ChannelItemSortField.DateCreated, SortDescending = true, UserId = request.UserId }, cancellationToken).ConfigureAwait(false); return result.Items; }