Moving the crawler reference to the Controller Call

This commit is contained in:
Zoe Roux 2020-02-10 22:23:07 +01:00
parent d28f976d2b
commit 7b080ce0df

View File

@ -1,10 +1,5 @@
using Kyoo.Controllers;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNetCore.Mvc;
using System.Threading;
using System.Threading.Tasks;
namespace Kyoo.Controllers
{
@ -12,15 +7,8 @@ namespace Kyoo.Controllers
[ApiController]
public class AdminController : ControllerBase
{
private readonly ICrawler crawler;
public AdminController(ICrawler crawler)
{
this.crawler = crawler;
}
[HttpGet("scan")]
public IActionResult ScanLibrary()
[HttpGet("scan")]
public IActionResult ScanLibrary(ICrawler crawler)
{
crawler.StartAsync(new CancellationToken());
return Ok("Scanning");