From b4f97eefcf0cbcca71701819547029cd980fd367 Mon Sep 17 00:00:00 2001 From: Glax Date: Sun, 24 Dec 2023 16:34:54 +0100 Subject: [PATCH] Fix comparisons --- Tranga/Jobs/UpdateMetadata.cs | 3 ++- Tranga/Manga.cs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Tranga/Jobs/UpdateMetadata.cs b/Tranga/Jobs/UpdateMetadata.cs index 7cbd7af..725c60f 100644 --- a/Tranga/Jobs/UpdateMetadata.cs +++ b/Tranga/Jobs/UpdateMetadata.cs @@ -23,10 +23,11 @@ public class UpdateMetadata : Job protected override IEnumerable ExecuteReturnSubTasksInternal(JobBoss jobBoss) { + //Retrieve new Metadata Manga? possibleUpdatedManga = mangaConnector.GetMangaFromId(manga.publicationId); if (possibleUpdatedManga is { } updatedManga) { - if(updatedManga.Equals(this.manga)) + if(updatedManga.Equals(this.manga))//Check if anything changed return Array.Empty(); this.manga.UpdateMetadata(updatedManga); diff --git a/Tranga/Manga.cs b/Tranga/Manga.cs index e23296b..3ab003b 100644 --- a/Tranga/Manga.cs +++ b/Tranga/Manga.cs @@ -77,7 +77,7 @@ public struct Manga this.sortName = newManga.sortName; this.description = newManga.description; foreach (string author in newManga.authors) - if(this.authors.Contains(author)) + if(!this.authors.Contains(author)) this.authors.Add(author); this.status = newManga.status; this.year = newManga.year; @@ -93,7 +93,7 @@ public struct Manga this.releaseStatus == compareManga.releaseStatus && this.sortName == compareManga.sortName && this.latestChapterAvailable.Equals(compareManga.latestChapterAvailable) && - this.tags.Equals(compareManga.tags); + this.tags.SequenceEqual(compareManga.tags); } public override string ToString()