public async Task <IActionResult> PutSeriesVideo(string seriesId, string videoId) { // Get existing item Series series = await Series.GetSeries(_driver, seriesId); if (series == null) { return(NotFound()); } if (await series.AddVideo(_driver, videoId)) { return(NoContent()); } else { return(BadRequest()); } }
// temp public async Task GenerateTestData(IDriver driver) { Channel channel = new Channel { Name = "raocow", YoutubeId = "raocow", Updated = DateTime.UtcNow }; await channel.Save(driver); Series series = new Series { Name = "super marisa world", Updated = DateTime.UtcNow }; await series.Save(driver); for (int i = 0; i < 100; ++i) { Video video = new Video { Title = "Super marisa world " + i, YoutubeId = "blarg", Published = DateTime.UtcNow }; await video.Save(driver); await channel.AddVideo(driver, video.Id); await series.AddVideo(driver, video.Id); } }