From 77f93d87f98479b4d630342211e7b0548c7b2340 Mon Sep 17 00:00:00 2001 From: glax Date: Thu, 2 Nov 2023 15:48:17 +0100 Subject: [PATCH] UpdateMetadata now finishes correctly. --- Tranga/Jobs/UpdateMetadata.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Tranga/Jobs/UpdateMetadata.cs b/Tranga/Jobs/UpdateMetadata.cs index c7e25ec..db679a1 100644 --- a/Tranga/Jobs/UpdateMetadata.cs +++ b/Tranga/Jobs/UpdateMetadata.cs @@ -26,6 +26,9 @@ public class UpdateMetadata : Job Manga? possibleUpdatedManga = mangaConnector.GetMangaFromId(manga.publicationId); if (possibleUpdatedManga is { } updatedManga) { + if(updatedManga.Equals(this.manga)) + return Array.Empty(); + cachedPublications.Remove(this.manga); this.manga = updatedManga; cachedPublications.Add(updatedManga); @@ -38,12 +41,15 @@ public class UpdateMetadata : Job throw new Exception("Jobtype has to be DownloadNewChapters"); dncJob.manga = updatedManga; } + this.progressToken.Complete(); } else { Log($"Could not find Manga {manga}"); + this.progressToken.Cancel(); return Array.Empty(); } + this.progressToken.Cancel(); return Array.Empty(); } } \ No newline at end of file