LibGroup chapter numbers fix (#4012)

* chapter numbers fix

* chapter numbers fix

---------

Co-authored-by: romshke <@>
This commit is contained in:
Roman 2024-07-16 08:28:03 +03:00 committed by Draff
parent 41812dd97b
commit c9280eb5b2
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
3 changed files with 3 additions and 4 deletions

View File

@ -2,4 +2,4 @@ plugins {
id("lib-multisrc")
}
baseVersionCode = 28
baseVersionCode = 29

View File

@ -324,7 +324,7 @@ abstract class LibGroup(
if (currentBranch.value.branchId == defaultBranchId && sortingList == "ms_mixing") { // ms_mixing with default branch from api
chapters.add(it.value.toSChapter(slugUrl, defaultBranchId, isScanUser()))
} else if (defaultBranchId == null && sortingList == "ms_mixing") { // ms_mixing with first branch in chapter
if (chapters.any { chpIt -> chpIt.chapter_number == it.value.itemNumber }) {
if (chapters.any { chpIt -> chpIt.chapter_number == it.value.number.toFloat() }) {
chapters.add(it.value.toSChapter(slugUrl, currentBranch.value.branchId, isScanUser()))
}
} else if (sortingList == "ms_combining") { // ms_combining

View File

@ -202,7 +202,6 @@ class Chapter(
val name: String?,
val number: String,
val volume: String,
@SerialName("item_number") val itemNumber: Float?,
) {
@Serializable
class Branch(
@ -241,7 +240,7 @@ class Chapter(
url = "/$slugUrl/chapter?$branchStr&volume=$volume&number=$number"
scanlator = getTeamName(branchId) ?: if (isScanUser) getUserName(branchId) else null
date_upload = runCatching { LibGroup.simpleDateFormat.parse(first(branchId)!!.createdAt)!!.time }.getOrDefault(0L)
chapter_number = itemNumber ?: -1f
chapter_number = number.toFloat()
}
}