From 29252060487ba6c19798143cd6302ec9459e3ff7 Mon Sep 17 00:00:00 2001 From: glax <--local> Date: Thu, 18 May 2023 18:20:37 +0200 Subject: [PATCH] fixed chapter order --- Tranga/Connectors/MangaDex.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Tranga/Connectors/MangaDex.cs b/Tranga/Connectors/MangaDex.cs index 691f826..eafd051 100644 --- a/Tranga/Connectors/MangaDex.cs +++ b/Tranga/Connectors/MangaDex.cs @@ -1,4 +1,5 @@ -using System.Text.Json; +using System.Globalization; +using System.Text.Json; using System.Text.Json.Nodes; namespace Tranga.Connectors; @@ -151,7 +152,12 @@ public class MangaDex : Connector chapters.Add(new Chapter(publication, title, volume, chapterNum, chapterId)); } } - return chapters.OrderBy(chapter => chapter.chapterNumber).ToArray(); + + NumberFormatInfo chapterNumberFormatInfo = new NumberFormatInfo() + { + NumberDecimalSeparator = "." + }; + return chapters.OrderBy(chapter => Convert.ToSingle(chapter.chapterNumber, chapterNumberFormatInfo)).ToArray(); } public override void DownloadChapter(Publication publication, Chapter chapter)