Update Komga/Kavita immediately after new chapter is Downloaded

This commit is contained in:
glax 2023-07-03 00:01:08 +02:00
parent 58a62f8272
commit 398ac304d2

View File

@ -27,9 +27,14 @@ public class DownloadChapterTask : TrangaTask
Connector connector = taskManager.GetConnector(this.connectorName);
connector.CopyCoverFromCacheToDownloadLocation(this.publication, taskManager.settings);
HttpStatusCode downloadSuccess = connector.DownloadChapter(this.publication, this.chapter, this, cancellationToken);
if((int)downloadSuccess >= 200 && (int)downloadSuccess < 300)
if ((int)downloadSuccess >= 200 && (int)downloadSuccess < 300)
{
foreach(NotificationManager nm in taskManager.settings.notificationManagers)
nm.SendNotification("Chapter downloaded", $"{this.publication.sortName} {this.chapter.chapterNumber} {this.chapter.name}");
foreach (LibraryManager lm in taskManager.settings.libraryManagers)
lm.UpdateLibrary();
}
return downloadSuccess;
}