2
0

Fix comparisons

This commit is contained in:
Glax 2023-12-24 16:34:54 +01:00
parent 29f6de2590
commit b4f97eefcf
2 changed files with 4 additions and 3 deletions

View File

@ -23,10 +23,11 @@ public class UpdateMetadata : Job
protected override IEnumerable<Job> ExecuteReturnSubTasksInternal(JobBoss jobBoss) protected override IEnumerable<Job> ExecuteReturnSubTasksInternal(JobBoss jobBoss)
{ {
//Retrieve new Metadata
Manga? possibleUpdatedManga = mangaConnector.GetMangaFromId(manga.publicationId); Manga? possibleUpdatedManga = mangaConnector.GetMangaFromId(manga.publicationId);
if (possibleUpdatedManga is { } updatedManga) if (possibleUpdatedManga is { } updatedManga)
{ {
if(updatedManga.Equals(this.manga)) if(updatedManga.Equals(this.manga))//Check if anything changed
return Array.Empty<Job>(); return Array.Empty<Job>();
this.manga.UpdateMetadata(updatedManga); this.manga.UpdateMetadata(updatedManga);

View File

@ -77,7 +77,7 @@ public struct Manga
this.sortName = newManga.sortName; this.sortName = newManga.sortName;
this.description = newManga.description; this.description = newManga.description;
foreach (string author in newManga.authors) foreach (string author in newManga.authors)
if(this.authors.Contains(author)) if(!this.authors.Contains(author))
this.authors.Add(author); this.authors.Add(author);
this.status = newManga.status; this.status = newManga.status;
this.year = newManga.year; this.year = newManga.year;
@ -93,7 +93,7 @@ public struct Manga
this.releaseStatus == compareManga.releaseStatus && this.releaseStatus == compareManga.releaseStatus &&
this.sortName == compareManga.sortName && this.sortName == compareManga.sortName &&
this.latestChapterAvailable.Equals(compareManga.latestChapterAvailable) && this.latestChapterAvailable.Equals(compareManga.latestChapterAvailable) &&
this.tags.Equals(compareManga.tags); this.tags.SequenceEqual(compareManga.tags);
} }
public override string ToString() public override string ToString()