From 7b080ce0df7a4ca935f9d89f593879c04336ad13 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Mon, 10 Feb 2020 22:23:07 +0100 Subject: [PATCH] Moving the crawler reference to the Controller Call --- Kyoo/HtmlAPI/AdminAPI.cs | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/Kyoo/HtmlAPI/AdminAPI.cs b/Kyoo/HtmlAPI/AdminAPI.cs index 23f9e4a1..eb8782c1 100644 --- a/Kyoo/HtmlAPI/AdminAPI.cs +++ b/Kyoo/HtmlAPI/AdminAPI.cs @@ -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");