HUGE arch changes to make searching work right

This commit is contained in:
2018-03-05 01:08:55 -05:00
parent 96a26ce30d
commit 9f5fb78835
32 changed files with 800 additions and 447 deletions

View File

@ -82,23 +82,6 @@ namespace YTManager.Controllers.Private
return NoContent();
}
[HttpPost("{channelid}")]
public async Task<IActionResult> PostChannel([FromRoute] string channelid) {
// Only add it to the databse if it's not in there already.
if (db.Channels.Any(c => c.YoutubeID == channelid))
return BadRequest();
// Get the channel contents from youtube.
var channel = await Tasks.FetchVideos.Get_YTChannel(channelid);
// Add it to the databse.
await db.Channels.AddAsync(channel);
await db.SaveChangesAsync();
// Say all went ok.
return Ok(channel);
}
[HttpPost]
public async Task<IActionResult> PostChannel([FromBody] Channel channel)
{