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 System.Runtime.InteropServices;
|
||||||
using API.MangaDownloadClients;
|
using API.MangaDownloadClients;
|
||||||
using API.Schema.Contexts;
|
using API.Schema.Contexts;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SixLabors.ImageSharp;
|
using SixLabors.ImageSharp;
|
||||||
using SixLabors.ImageSharp.Formats.Jpeg;
|
using SixLabors.ImageSharp.Formats.Jpeg;
|
||||||
@ -37,6 +38,7 @@ public class DownloadSingleChapterJob : Job
|
|||||||
protected override IEnumerable<Job> RunInternal(PgsqlContext context)
|
protected override IEnumerable<Job> RunInternal(PgsqlContext context)
|
||||||
{
|
{
|
||||||
context.Attach(Chapter);
|
context.Attach(Chapter);
|
||||||
|
context.Attach(Chapter.ParentManga);
|
||||||
string[] imageUrls = Chapter.ParentManga.MangaConnector.GetChapterImageUrls(Chapter);
|
string[] imageUrls = Chapter.ParentManga.MangaConnector.GetChapterImageUrls(Chapter);
|
||||||
if (imageUrls.Length < 1)
|
if (imageUrls.Length < 1)
|
||||||
{
|
{
|
||||||
@ -97,6 +99,7 @@ public class DownloadSingleChapterJob : Job
|
|||||||
Chapter.Downloaded = true;
|
Chapter.Downloaded = true;
|
||||||
context.SaveChanges();
|
context.SaveChanges();
|
||||||
|
|
||||||
|
context.Jobs.Load();
|
||||||
if (context.Jobs.AsEnumerable().Any(j =>
|
if (context.Jobs.AsEnumerable().Any(j =>
|
||||||
{
|
{
|
||||||
if (j.JobType != JobType.UpdateFilesDownloadedJob)
|
if (j.JobType != JobType.UpdateFilesDownloadedJob)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user