mirror of
https://github.com/C9Glax/tranga.git
synced 2025-05-22 06:03:01 +02:00
DownloadSingleChapterJob.cs load Jobs
This commit is contained in:
parent
adc7ee606e
commit
be2adff57d
@ -3,6 +3,7 @@ using System.IO.Compression;
|
||||
using System.Runtime.InteropServices;
|
||||
using API.MangaDownloadClients;
|
||||
using API.Schema.Contexts;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Newtonsoft.Json;
|
||||
using SixLabors.ImageSharp;
|
||||
using SixLabors.ImageSharp.Formats.Jpeg;
|
||||
@ -37,6 +38,7 @@ public class DownloadSingleChapterJob : Job
|
||||
protected override IEnumerable<Job> RunInternal(PgsqlContext context)
|
||||
{
|
||||
context.Attach(Chapter);
|
||||
context.Attach(Chapter.ParentManga);
|
||||
string[] imageUrls = Chapter.ParentManga.MangaConnector.GetChapterImageUrls(Chapter);
|
||||
if (imageUrls.Length < 1)
|
||||
{
|
||||
@ -97,6 +99,7 @@ public class DownloadSingleChapterJob : Job
|
||||
Chapter.Downloaded = true;
|
||||
context.SaveChanges();
|
||||
|
||||
context.Jobs.Load();
|
||||
if (context.Jobs.AsEnumerable().Any(j =>
|
||||
{
|
||||
if (j.JobType != JobType.UpdateFilesDownloadedJob)
|
||||
|
Loading…
x
Reference in New Issue
Block a user