update m+ for new chapter list format
This commit is contained in:
parent
cbfdd982ff
commit
2f2671757e
@ -76,6 +76,7 @@ class TitleDetailView(
|
|||||||
val viewingPeriodDescription: String = "",
|
val viewingPeriodDescription: String = "",
|
||||||
val nonAppearanceInfo: String = "",
|
val nonAppearanceInfo: String = "",
|
||||||
val chapterListGroup: List<ChapterListGroup> = emptyList(),
|
val chapterListGroup: List<ChapterListGroup> = emptyList(),
|
||||||
|
val chapterListV2: List<Chapter> = emptyList(),
|
||||||
val isSimulReleased: Boolean = false,
|
val isSimulReleased: Boolean = false,
|
||||||
val rating: Rating = Rating.ALL_AGES,
|
val rating: Rating = Rating.ALL_AGES,
|
||||||
val chaptersDescending: Boolean = true,
|
val chaptersDescending: Boolean = true,
|
||||||
@ -84,13 +85,18 @@ class TitleDetailView(
|
|||||||
) {
|
) {
|
||||||
|
|
||||||
val chapterList: List<Chapter> by lazy {
|
val chapterList: List<Chapter> by lazy {
|
||||||
// Doesn't include `midChapterList` by design as their site API returns it
|
// Use the new V2 format if available, otherwise fall back to the old format
|
||||||
// just for visual representation to redirect users to their app. The extension
|
if (chapterListV2.isNotEmpty()) {
|
||||||
// intends to allow users to read only what they can already read in their site.
|
chapterListV2
|
||||||
if (titleLabels.planType != "standard") {
|
|
||||||
chapterListGroup.flatMap { it.firstChapterList + it.lastChapterList }
|
|
||||||
} else {
|
} 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 chapterId: Int,
|
||||||
val name: String,
|
val name: String,
|
||||||
val subTitle: String? = null,
|
val subTitle: String? = null,
|
||||||
|
val thumbnailUrl: String? = null,
|
||||||
val startTimeStamp: Int,
|
val startTimeStamp: Int,
|
||||||
val endTimeStamp: Int,
|
val endTimeStamp: Int,
|
||||||
val isVerticalOnly: Boolean = false,
|
val isVerticalOnly: Boolean = false,
|
||||||
|
val alreadyViewed: Boolean = false,
|
||||||
|
val viewedForFree: Boolean = false,
|
||||||
|
val viewCount: Int = 0,
|
||||||
|
val commentCount: Int = 0,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
val isExpired: Boolean
|
val isExpired: Boolean
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user