Huge API rewrite

This commit is contained in:
2018-02-24 01:10:12 -05:00
parent a37fe30b6f
commit 038d363b00
16 changed files with 472 additions and 77 deletions

View File

@ -20,7 +20,7 @@ namespace YTManager.Controllers {
Title = c.Title;
Description = c.Description;
ID = c.YoutubeID;
Video_IDs = c.Videos?.Select(v => v.YoutubeID).ToList();
Video_IDs = c.Videos.Select(v => v.YoutubeID).ToList();
}
}
@ -38,6 +38,7 @@ namespace YTManager.Controllers {
public async Task<IActionResult> Get() {
// Get all the relevant channels.
var chanels = await db.Channels
.Include(c => c.Videos)
.OrderByDescending(i => i.AddedtoDB)
.Take(max_per_query)
.ToListAsync();