From 17c66d0fca69fd1b733b6011028bdcc7f6af4e67 Mon Sep 17 00:00:00 2001 From: pssandhu Date: Thu, 25 May 2023 13:01:39 +0100 Subject: [PATCH] Ensure chapters are sorted when getting continue point (#2011) Fixes new behaviour in #1625 --- API/Services/ReaderService.cs | 3 ++- openapi.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/API/Services/ReaderService.cs b/API/Services/ReaderService.cs index 648f05dfa..d7bef07f0 100644 --- a/API/Services/ReaderService.cs +++ b/API/Services/ReaderService.cs @@ -501,7 +501,8 @@ public class ReaderService : IReaderService if (currentlyReadingChapter != null) return currentlyReadingChapter; // Order with volume 0 last so we prefer the natural order - return FindNextReadingChapter(volumes.OrderBy(v => v.Number, SortComparerZeroLast.Default).SelectMany(v => v.Chapters).ToList()); + return FindNextReadingChapter(volumes.OrderBy(v => v.Number, SortComparerZeroLast.Default) + .SelectMany(v => v.Chapters.OrderBy(c => double.Parse(c.Number))).ToList()); } private static ChapterDto FindNextReadingChapter(IList volumeChapters) diff --git a/openapi.json b/openapi.json index f3666479e..30acb3e1d 100644 --- a/openapi.json +++ b/openapi.json @@ -7,7 +7,7 @@ "name": "GPL-3.0", "url": "https://github.com/Kareadita/Kavita/blob/develop/LICENSE" }, - "version": "0.7.2.16" + "version": "0.7.2.18" }, "servers": [ {