Added parentJobId for deserialization

When creating Jobs with null as recurrence time, set it to zero
Job.NextExecution() removed the recurrence check
This commit is contained in:
2023-09-02 16:11:56 +02:00
parent 79bbc92467
commit 51a1ae72ca
5 changed files with 34 additions and 34 deletions

View File

@ -11,7 +11,11 @@ public class JobBoss : GlobalBase
public JobBoss(GlobalBase clone, HashSet<MangaConnector> connectors) : base(clone)
{
if (File.Exists(settings.jobsFilePath))
{
this.jobs = JsonConvert.DeserializeObject<HashSet<Job>>(File.ReadAllText(settings.jobsFilePath), new JobJsonConverter(this, new MangaConnectorJsonConverter(this, connectors)))!;
foreach (Job job in this.jobs)
this.jobs.FirstOrDefault(jjob => jjob.id == job.parentJobId)?.AddSubJob(job);
}
else
this.jobs = new();
foreach (DownloadNewChapters ncJob in this.jobs.Where(job => job is DownloadNewChapters))