using System.Threading.Tasks;
using Hangfire;
using Kavita.Common.Constants;
using Kavita.Models.Constants;
namespace Kavita.API.Services.Scanner;
public interface IScannerService
{
///
/// Given a library id, scans folders for said library. Parses files and generates DB updates. Will overwrite
/// cover images if forceUpdate is true.
///
/// Library to scan against
/// Don't perform optimization checks, defaults to false
[Queue(TaskSchedulerConstants.ScanQueue)]
[DisableConcurrentExecution(60 * 60 * 60)]
[AutomaticRetry(Attempts = 3, OnAttemptsExceeded = AttemptsExceededAction.Delete)]
Task ScanLibrary(int libraryId, bool forceUpdate = false, bool isSingleScan = true);
[Queue(TaskSchedulerConstants.ScanQueue)]
[DisableConcurrentExecution(60 * 60 * 60)]
[AutomaticRetry(Attempts = 3, OnAttemptsExceeded = AttemptsExceededAction.Delete)]
Task ScanLibraries(bool forceUpdate = false);
[Queue(TaskSchedulerConstants.ScanQueue)]
[DisableConcurrentExecution(60 * 60 * 60)]
[AutomaticRetry(Attempts = 3, OnAttemptsExceeded = AttemptsExceededAction.Delete)]
Task ScanSeries(int seriesId, bool bypassFolderOptimizationChecks = true);
Task ScanFolder(string folder, string originalPath, bool abortOnNoSeriesMatch = false);
Task AnalyzeFiles();
}