diff --git a/Tranga/Manga.cs b/Tranga/Manga.cs index 36ae388..85ec6d6 100644 --- a/Tranga/Manga.cs +++ b/Tranga/Manga.cs @@ -12,14 +12,14 @@ namespace Tranga; public struct Manga { public string sortName { get; private set; } - public List authors { get; } + public List authors { get; private set; } // ReSharper disable once UnusedAutoPropertyAccessor.Global - public Dictionary altTitles { get; } + public Dictionary altTitles { get; private set; } // ReSharper disable once MemberCanBePrivate.Global public string? description { get; private set; } - public string[] tags { get; } + public string[] tags { get; private set; } // ReSharper disable once UnusedAutoPropertyAccessor.Global - public string? coverUrl { get; } + public string? coverUrl { get; private set; } public string? coverFileNameInCache { get; } // ReSharper disable once UnusedAutoPropertyAccessor.Global public Dictionary links { get; } @@ -76,9 +76,10 @@ public struct Manga { this.sortName = newManga.sortName; this.description = newManga.description; - foreach (string author in newManga.authors) - if(!this.authors.Contains(author)) - this.authors.Add(author); + this.coverUrl = newManga.coverUrl; + this.authors = authors.Union(newManga.authors).ToList(); + this.altTitles = altTitles.Concat(newManga.altTitles).ToDictionary(x => x.Key, x => x.Value); + this.tags = tags.Union(newManga.tags).ToArray(); this.status = newManga.status; this.releaseStatus = newManga.releaseStatus; this.year = newManga.year; @@ -94,7 +95,8 @@ public struct Manga this.releaseStatus == compareManga.releaseStatus && this.sortName == compareManga.sortName && this.latestChapterAvailable.Equals(compareManga.latestChapterAvailable) && - this.tags.SequenceEqual(compareManga.tags); + this.authors.All(a => compareManga.authors.Contains(a)) && + this.tags.All(t => compareManga.tags.Contains(t)); } public override string ToString()