From 21b8c7e0719d832a15a33ae0120aae36750e15e5 Mon Sep 17 00:00:00 2001 From: glax Date: Fri, 19 May 2023 19:53:59 +0200 Subject: [PATCH] Added summary for Publication --- Tranga/Publication.cs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Tranga/Publication.cs b/Tranga/Publication.cs index 597f15b..bd95711 100644 --- a/Tranga/Publication.cs +++ b/Tranga/Publication.cs @@ -2,6 +2,9 @@ namespace Tranga; +/// +/// Contains information on a Publication (Manga) +/// public struct Publication { public string sortName { get; } @@ -31,19 +34,25 @@ public struct Publication this.folderName = string.Concat(sortName.Split(Path.GetInvalidPathChars())); } + /// + /// + /// + /// Serialized JSON String for series.json public string GetSeriesInfo() { SeriesInfo si = new (new Metadata(this.sortName, this.year.ToString() ?? string.Empty, this.status, this.description ?? "")); return System.Text.Json.JsonSerializer.Serialize(si); } - - internal struct SeriesInfo + + //Only for series.json + private struct SeriesInfo { [JsonRequired]public Metadata metadata { get; } public SeriesInfo(Metadata metadata) => this.metadata = metadata; } - - internal struct Metadata + + //Only for series.json + private struct Metadata { [JsonRequired]public string name { get; } [JsonRequired]public string year { get; }