Split UpdateFilesDownloadedJob.cs to UpdateChaptersDownloadedJob.cs and split into UpdateSingleChapterDownloadedJob.cs

This commit is contained in:
2025-05-16 20:12:08 +02:00
parent be2adff57d
commit 563afa1e6f
17 changed files with 951 additions and 71 deletions

View File

@ -158,7 +158,7 @@ public class JobController(PgsqlContext context, ILog Log) : Controller
}
/// <summary>
/// Create a new UpdateFilesDownloadedJob
/// Create a new UpdateChaptersDownloadedJob
/// </summary>
/// <param name="MangaId">ID of the Manga</param>
/// <response code="201">Job-IDs</response>
@ -172,7 +172,7 @@ public class JobController(PgsqlContext context, ILog Log) : Controller
{
if(context.Mangas.Find(MangaId) is not { } m)
return NotFound();
Job job = new UpdateFilesDownloadedJob(m, 0);
Job job = new UpdateChaptersDownloadedJob(m, 0);
return AddJobs([job]);
}
@ -186,7 +186,7 @@ public class JobController(PgsqlContext context, ILog Log) : Controller
[ProducesResponseType<string>(Status500InternalServerError, "text/plain")]
public IActionResult CreateUpdateAllFilesDownloadedJob()
{
List<UpdateFilesDownloadedJob> jobs = context.Mangas.Select(m => new UpdateFilesDownloadedJob(m, 0, null, null)).ToList();
List<UpdateChaptersDownloadedJob> jobs = context.Mangas.Select(m => new UpdateChaptersDownloadedJob(m, 0, null, null)).ToList();
try
{
context.Jobs.AddRange(jobs);

View File

@ -343,7 +343,7 @@ public class MangaController(PgsqlContext context, ILog Log) : Controller
return NotFound();
MoveMangaLibraryJob moveLibrary = new(manga, library);
UpdateFilesDownloadedJob updateDownloadedFiles = new(manga, 0, dependsOnJobs: [moveLibrary]);
UpdateChaptersDownloadedJob updateDownloadedFiles = new(manga, 0, dependsOnJobs: [moveLibrary]);
try
{