mirror of
https://github.com/C9Glax/tranga.git
synced 2025-07-06 19:04:18 +02:00
Library- and NotificationConnectors in GlobalBase
This commit is contained in:
@ -6,7 +6,7 @@ public class DownloadChapter : Job
|
||||
{
|
||||
public Chapter chapter { get; init; }
|
||||
|
||||
public DownloadChapter(MangaConnector connector, Chapter chapter) : base(connector)
|
||||
public DownloadChapter(GlobalBase clone, MangaConnector connector, Chapter chapter) : base(clone, connector)
|
||||
{
|
||||
this.chapter = chapter;
|
||||
}
|
||||
@ -16,6 +16,8 @@ public class DownloadChapter : Job
|
||||
Task downloadTask = new(delegate
|
||||
{
|
||||
mangaConnector.DownloadChapter(chapter, this.progressToken);
|
||||
UpdateLibraries();
|
||||
SendNotifications("Chapter downloaded", $"{chapter.parentPublication.sortName} - {chapter.chapterNumber}");
|
||||
});
|
||||
downloadTask.Start();
|
||||
return Array.Empty<Job>();
|
||||
|
@ -6,7 +6,7 @@ public class DownloadNewChapters : Job
|
||||
{
|
||||
public Publication publication { get; init; }
|
||||
|
||||
public DownloadNewChapters(MangaConnector connector, Publication publication, bool recurring = false) : base (connector, recurring)
|
||||
public DownloadNewChapters(GlobalBase clone, MangaConnector connector, Publication publication, bool recurring = false) : base (clone, connector, recurring)
|
||||
{
|
||||
this.publication = publication;
|
||||
}
|
||||
@ -18,7 +18,7 @@ public class DownloadNewChapters : Job
|
||||
List<Job> subJobs = new();
|
||||
foreach (Chapter chapter in chapters)
|
||||
{
|
||||
DownloadChapter downloadChapterJob = new(this.mangaConnector, chapter);
|
||||
DownloadChapter downloadChapterJob = new(this, this.mangaConnector, chapter);
|
||||
subJobs.Add(downloadChapterJob);
|
||||
}
|
||||
progressToken.Complete();
|
||||
|
Reference in New Issue
Block a user