mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
Moving the crawler reference to the Controller Call
This commit is contained in:
parent
d28f976d2b
commit
7b080ce0df
@ -1,10 +1,5 @@
|
|||||||
using Kyoo.Controllers;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Kyoo.Controllers
|
namespace Kyoo.Controllers
|
||||||
{
|
{
|
||||||
@ -12,15 +7,8 @@ namespace Kyoo.Controllers
|
|||||||
[ApiController]
|
[ApiController]
|
||||||
public class AdminController : ControllerBase
|
public class AdminController : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly ICrawler crawler;
|
[HttpGet("scan")]
|
||||||
|
public IActionResult ScanLibrary(ICrawler crawler)
|
||||||
public AdminController(ICrawler crawler)
|
|
||||||
{
|
|
||||||
this.crawler = crawler;
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet("scan")]
|
|
||||||
public IActionResult ScanLibrary()
|
|
||||||
{
|
{
|
||||||
crawler.StartAsync(new CancellationToken());
|
crawler.StartAsync(new CancellationToken());
|
||||||
return Ok("Scanning");
|
return Ok("Scanning");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user