From e0784b2c380491787bbfa57f0c4edffe9faadb9e Mon Sep 17 00:00:00 2001 From: glax Date: Sat, 20 May 2023 02:39:23 +0200 Subject: [PATCH] Added field sortNumber to chapter --- Tranga/Chapter.cs | 6 ++++-- Tranga/Connector.cs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Tranga/Chapter.cs b/Tranga/Chapter.cs index 17c21f5..0c4acf0 100644 --- a/Tranga/Chapter.cs +++ b/Tranga/Chapter.cs @@ -13,6 +13,7 @@ public struct Chapter public string? chapterNumber { get; } public string url { get; } public string fileName { get; } + public string sortNumber { get; } public Chapter(string? name, string? volumeNumber, string? chapterNumber, string url) { @@ -25,7 +26,8 @@ public struct Chapter { NumberDecimalSeparator = "." }; - decimal orderNumber = Convert.ToDecimal(volumeNumber) * Convert.ToDecimal(chapterNumber, nfi); - this.fileName = $"{chapterName} - V{volumeNumber}C{chapterNumber} - {decimal.Round(orderNumber, 1).ToString(nfi)}"; + sortNumber = decimal.Round(Convert.ToDecimal(volumeNumber) * Convert.ToDecimal(chapterNumber, nfi), 1) + .ToString(nfi); + this.fileName = $"{chapterName} - V{volumeNumber}C{chapterNumber} - {sortNumber}"; } } \ No newline at end of file diff --git a/Tranga/Connector.cs b/Tranga/Connector.cs index 4160890..2aa19d5 100644 --- a/Tranga/Connector.cs +++ b/Tranga/Connector.cs @@ -75,7 +75,7 @@ public abstract class Connector new XElement("LanguageISO", publication.originalLanguage), new XElement("Title", chapter.name), new XElement("Volume", chapter.volumeNumber), - new XElement("Number", chapter.chapterNumber) + new XElement("Number", chapter.sortNumber) ); return comicInfo.ToString(); }