From 425cf7e0d60863314e294f9a21cb5d5de76e5948 Mon Sep 17 00:00:00 2001 From: glax Date: Wed, 1 Nov 2023 13:36:58 +0100 Subject: [PATCH] Re-add forgotten seriesInfo.json to new downloads --- Tranga/Jobs/DownloadNewChapters.cs | 1 + Tranga/Manga.cs | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Tranga/Jobs/DownloadNewChapters.cs b/Tranga/Jobs/DownloadNewChapters.cs index 6e2e3f2..9f2268f 100644 --- a/Tranga/Jobs/DownloadNewChapters.cs +++ b/Tranga/Jobs/DownloadNewChapters.cs @@ -33,6 +33,7 @@ public class DownloadNewChapters : Job protected override IEnumerable ExecuteReturnSubTasksInternal() { + manga.SaveSeriesInfoJson(settings.downloadLocation); Chapter[] chapters = mangaConnector.GetNewChapters(manga, this.translatedLanguage); this.progressToken.increments = chapters.Length; List jobs = new(); diff --git a/Tranga/Manga.cs b/Tranga/Manga.cs index 4424bc9..7745a8a 100644 --- a/Tranga/Manga.cs +++ b/Tranga/Manga.cs @@ -105,7 +105,7 @@ public struct Manga /// Serialized JSON String for series.json private string GetSeriesInfoJson() { - SeriesInfo si = new (new Metadata(this.sortName, this.year.ToString() ?? string.Empty, this.status, this.description ?? "")); + SeriesInfo si = new (new Metadata(this)); return System.Text.Json.JsonSerializer.Serialize(si); } @@ -150,6 +150,11 @@ public struct Manga "cancellato", "droppato" }; + + public Metadata(Manga manga) : this(manga.sortName, manga.year.ToString() ?? string.Empty, manga.status, manga.description ?? "") + { + + } public Metadata(string name, string year, string status, string description_text) {