Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
C9Glax committed Feb 2, 2024
1 parent c706824 commit aa692f6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Tranga/Jobs/JobJsonConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ public override object ReadJson(JsonReader reader, Type objectType, object? exis
jo.GetValue("parentJobId")!.Value<string?>());
}else if ((jo.ContainsKey("jobType") && jo["jobType"]!.Value<byte>() == (byte)Job.JobType.DownloadNewChaptersJob) || jo.ContainsKey("translatedLanguage"))//TODO change to jobType
{
DateTime lastExecution = jo.GetValue("lastExecution") is {} le
? le.ToObject<DateTime>()
: DateTime.UnixEpoch;
return new DownloadNewChapters(this._clone,
jo.GetValue("mangaConnector")!.ToObject<MangaConnector>(JsonSerializer.Create(new JsonSerializerSettings()
{
Expand All @@ -47,7 +50,7 @@ public override object ReadJson(JsonReader reader, Type objectType, object? exis
}
}))!,
jo.GetValue("manga")!.ToObject<Manga>(),
jo.GetValue("lastExecution")!.ToObject<DateTime>(),
lastExecution,
jo.GetValue("recurring")!.Value<bool>(),
jo.GetValue("recurrenceTime")!.ToObject<TimeSpan?>(),
jo.GetValue("parentJobId")!.Value<string?>());
Expand Down

0 comments on commit aa692f6

Please sign in to comment.