Re-add forgotten seriesInfo.json to new downloads

This commit is contained in:
glax 2023-11-01 13:36:58 +01:00
parent 8f5dd5aab5
commit 425cf7e0d6
2 changed files with 7 additions and 1 deletions

View File

@ -33,6 +33,7 @@ public class DownloadNewChapters : Job
protected override IEnumerable<Job> ExecuteReturnSubTasksInternal()
{
manga.SaveSeriesInfoJson(settings.downloadLocation);
Chapter[] chapters = mangaConnector.GetNewChapters(manga, this.translatedLanguage);
this.progressToken.increments = chapters.Length;
List<Job> jobs = new();

View File

@ -105,7 +105,7 @@ public struct Manga
/// <returns>Serialized JSON String for series.json</returns>
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)
{