Only send notifications if more than 0 new chapters

This commit is contained in:
glax 2023-06-28 19:23:06 +02:00
parent b099da1156
commit e70a14ca56

View File

@ -86,8 +86,9 @@ public abstract class TrangaTask
{
case Task.MonitorPublication:
MonitorPublicationTask mpt = (MonitorPublicationTask)this;
nm.SendNotification("Downloaded new chapters",
$"{mpt.publication.sortName}: {this.childTasks.Count(ct => ct.state is ExecutionState.Success)} new chapters.");
int successfulCount = this.childTasks.Count(ct => ct.state is ExecutionState.Success);
if(successfulCount > 0)
nm.SendNotification("Downloaded new chapters", $"{mpt.publication.sortName}: {successfulCount} new chapters.");
break;
case Task.DownloadChapter:
DownloadChapterTask dct = (DownloadChapterTask)this;