async Task <VideoRow> Video(ChannelVideoRow cv) { var v = await Yt.Videos.Get(cv.VideoId); if (v == null) { Log.Warning("Unable to find video {Video}", cv.VideoId); return(null); } return(new VideoRow { VideoId = v.VideoId, Title = v.VideoTitle, ChannelId = cv.ChannelId, PublishedAt = v.Latest.PublishedAt.ToString("O"), Views = (long)(v.Latest.Stats.Views ?? 0), /* * Stats = v.History.Select(h => new VideoRowStats { * Views = (long) (h.Views ?? 0), * Likes = (long) (h.Likes ?? 0), * Diskiles = (long) (h.Dislikes ?? 0), * UpdatedAt = h.Updated.ToString("O") * }).ToList()*/ }); }
async Task <VideoRow> Video(ChannelVideoRow cv) { var v = await Yt.Videos.Get(cv.VideoId); if (v == null) { Log.Warning("Unable to find video {Video}", cv.VideoId); return(null); } return(new VideoRow { VideoId = v.VideoId, Title = v.VideoTitle, ChannelId = cv.ChannelId, Views = (long)(v.Latest.Stats.Views ?? 0), PublishedAt = v.Latest.PublishedAt.ToString("O"), Tags = v.Latest.Tags.NotNull().ToArray() }); }