Skip to content

Commit

Permalink
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
Browse files Browse the repository at this point in the history
# Conflicts:
#	Tranga/Jobs/JobBoss.cs
  • Loading branch information
C9Glax committed May 26, 2024
2 parents 2cfc7ac + f499665 commit 27a5598
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions Tranga/Jobs/JobBoss.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,18 +150,35 @@ private void LoadJobsList(HashSet<MangaConnector> connectors)
//Load json-job-files
foreach (FileInfo file in new DirectoryInfo(settings.jobsFolderPath).EnumerateFiles().Where(fileInfo => idRex.IsMatch(fileInfo.Name)))
{
Job job = JsonConvert.DeserializeObject<Job>(File.ReadAllText(file.FullName),
new JobJsonConverter(this, new MangaConnectorJsonConverter(this, connectors)))!;
this.jobs.Add(job);
Log($"Adding {file.Name}");
Job? job = JsonConvert.DeserializeObject<Job>(File.ReadAllText(file.FullName),
new JobJsonConverter(this, new MangaConnectorJsonConverter(this, connectors)));
if (job is null)
{
string newName = file.FullName + ".failed";
Log($"Failed loading file {file.Name}.\nMoving to {newName}");
File.Move(file.FullName, newName);
}
else
{
Log($"Adding Job {job}");
this.jobs.Add(job);
}
}

//Load Manga-Files
ImportManga();

//Connect jobs to parent-jobs
//Connect jobs to parent-jobs and add Publications to cache
foreach (Job job in this.jobs)
{
this.jobs.FirstOrDefault(jjob => jjob.id == job.parentJobId)?.AddSubJob(job);
Log($"Loading Job {job}");
Job? parentJob = this.jobs.FirstOrDefault(jjob => jjob.id == job.parentJobId);
if (parentJob is not null)
{
parentJob.AddSubJob(job);
Log($"Parent Job {parentJob}");
}
}

string[] jobMangaInternalIds = this.jobs.Where(job => job is DownloadNewChapters)
Expand Down

0 comments on commit 27a5598

Please sign in to comment.