[RU]Remanga filter only the last non-purchased chapters (#18418)
* [RU]Remanga filter only the last non-purchased chapters * detect LICENSED when metadata not updated (when update library chapters) * simplify not paid
This commit is contained in:
parent
449f715df0
commit
2377974bd9
|
@ -6,7 +6,7 @@ ext {
|
||||||
extName = 'Remanga'
|
extName = 'Remanga'
|
||||||
pkgNameSuffix = 'ru.remanga'
|
pkgNameSuffix = 'ru.remanga'
|
||||||
extClass = '.Remanga'
|
extClass = '.Remanga'
|
||||||
extVersionCode = 81
|
extVersionCode = 82
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
|
@ -440,6 +440,9 @@ class Remanga : ConfigurableSource, HttpSource() {
|
||||||
val series = json.decodeFromJsonElement<MangaDetDto>(content)
|
val series = json.decodeFromJsonElement<MangaDetDto>(content)
|
||||||
branches[series.dir] = series.branches
|
branches[series.dir] = series.branches
|
||||||
mangaIDs[series.dir] = series.id
|
mangaIDs[series.dir] = series.id
|
||||||
|
if (parseStatus(series.status.id) == SManga.LICENSED && series.branches.maxByOrNull { selector(it) }!!.count_chapters == 0) {
|
||||||
|
throw Exception("Лицензировано - Нет глав")
|
||||||
|
}
|
||||||
series.branches
|
series.branches
|
||||||
} else {
|
} else {
|
||||||
emptyList()
|
emptyList()
|
||||||
|
@ -447,19 +450,16 @@ class Remanga : ConfigurableSource, HttpSource() {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun filterPaid(tempChaptersList: MutableList<SChapter>): MutableList<SChapter> {
|
private fun filterPaid(tempChaptersList: MutableList<SChapter>): MutableList<SChapter> {
|
||||||
val lastEx = tempChaptersList.find { it.scanlator.equals("exmanga") or it.url.contains("#is_bought") }
|
|
||||||
return if (!preferences.getBoolean(PAID_PREF, false)) {
|
return if (!preferences.getBoolean(PAID_PREF, false)) {
|
||||||
tempChaptersList.filter {
|
val lastEx = tempChaptersList.find { !it.name.contains("\uD83D\uDCB2") }
|
||||||
!it.name.contains("\uD83D\uDCB2") || if (lastEx != null) {
|
tempChaptersList.filterNot {
|
||||||
(
|
it.name.contains("\uD83D\uDCB2") && if (lastEx != null) {
|
||||||
(
|
val volCor = it.name.substringBefore(
|
||||||
it.name.substringBefore(
|
|
||||||
". Глава",
|
". Глава",
|
||||||
).toIntOrNull()!! <=
|
).toIntOrNull()!!
|
||||||
(lastEx.name.substringBefore(". Глава").toIntOrNull()!!)
|
val volLast = lastEx.name.substringBefore(". Глава").toIntOrNull()!!
|
||||||
) &&
|
(volCor > volLast) ||
|
||||||
(it.chapter_number < lastEx.chapter_number)
|
((volCor == volLast) && (it.chapter_number > lastEx.chapter_number))
|
||||||
)
|
|
||||||
} else {
|
} else {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue