From 2f2671757e1828cdd6aa708a6e052830e68df4a6 Mon Sep 17 00:00:00 2001 From: Draff Date: Sat, 22 Nov 2025 22:10:01 +0000 Subject: [PATCH] update m+ for new chapter list format --- .../extension/all/mangaplus/MangaPlusDto.kt | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/all/mangaplus/src/eu/kanade/tachiyomi/extension/all/mangaplus/MangaPlusDto.kt b/src/all/mangaplus/src/eu/kanade/tachiyomi/extension/all/mangaplus/MangaPlusDto.kt index df78d7694..e1b6ae478 100644 --- a/src/all/mangaplus/src/eu/kanade/tachiyomi/extension/all/mangaplus/MangaPlusDto.kt +++ b/src/all/mangaplus/src/eu/kanade/tachiyomi/extension/all/mangaplus/MangaPlusDto.kt @@ -76,6 +76,7 @@ class TitleDetailView( val viewingPeriodDescription: String = "", val nonAppearanceInfo: String = "", val chapterListGroup: List = emptyList(), + val chapterListV2: List = emptyList(), val isSimulReleased: Boolean = false, val rating: Rating = Rating.ALL_AGES, val chaptersDescending: Boolean = true, @@ -84,13 +85,18 @@ class TitleDetailView( ) { val chapterList: List by lazy { - // Doesn't include `midChapterList` by design as their site API returns it - // just for visual representation to redirect users to their app. The extension - // intends to allow users to read only what they can already read in their site. - if (titleLabels.planType != "standard") { - chapterListGroup.flatMap { it.firstChapterList + it.lastChapterList } + // Use the new V2 format if available, otherwise fall back to the old format + if (chapterListV2.isNotEmpty()) { + chapterListV2 } else { - chapterListGroup.flatMap { it.firstChapterList + it.midChapterList + it.lastChapterList } + // Doesn't include `midChapterList` by design as their site API returns it + // just for visual representation to redirect users to their app. The extension + // intends to allow users to read only what they can already read in their site. + if (titleLabels.planType != "standard") { + chapterListGroup.flatMap { it.firstChapterList + it.lastChapterList } + } else { + chapterListGroup.flatMap { it.firstChapterList + it.midChapterList + it.lastChapterList } + } } } @@ -322,9 +328,14 @@ class Chapter( val chapterId: Int, val name: String, val subTitle: String? = null, + val thumbnailUrl: String? = null, val startTimeStamp: Int, val endTimeStamp: Int, val isVerticalOnly: Boolean = false, + val alreadyViewed: Boolean = false, + val viewedForFree: Boolean = false, + val viewCount: Int = 0, + val commentCount: Int = 0, ) { val isExpired: Boolean