diff --git a/src/ru/remanga/build.gradle b/src/ru/remanga/build.gradle index 8cdef8c29..c4b29f7ce 100644 --- a/src/ru/remanga/build.gradle +++ b/src/ru/remanga/build.gradle @@ -6,7 +6,7 @@ ext { extName = 'Remanga' pkgNameSuffix = 'ru.remanga' extClass = '.Remanga' - extVersionCode = 81 + extVersionCode = 82 } dependencies { diff --git a/src/ru/remanga/src/eu/kanade/tachiyomi/extension/ru/remanga/Remanga.kt b/src/ru/remanga/src/eu/kanade/tachiyomi/extension/ru/remanga/Remanga.kt index 9a04c8a7b..8d4eefc36 100644 --- a/src/ru/remanga/src/eu/kanade/tachiyomi/extension/ru/remanga/Remanga.kt +++ b/src/ru/remanga/src/eu/kanade/tachiyomi/extension/ru/remanga/Remanga.kt @@ -440,6 +440,9 @@ class Remanga : ConfigurableSource, HttpSource() { val series = json.decodeFromJsonElement(content) branches[series.dir] = series.branches mangaIDs[series.dir] = series.id + if (parseStatus(series.status.id) == SManga.LICENSED && series.branches.maxByOrNull { selector(it) }!!.count_chapters == 0) { + throw Exception("Лицензировано - Нет глав") + } series.branches } else { emptyList() @@ -447,19 +450,16 @@ class Remanga : ConfigurableSource, HttpSource() { } private fun filterPaid(tempChaptersList: MutableList): MutableList { - val lastEx = tempChaptersList.find { it.scanlator.equals("exmanga") or it.url.contains("#is_bought") } return if (!preferences.getBoolean(PAID_PREF, false)) { - tempChaptersList.filter { - !it.name.contains("\uD83D\uDCB2") || if (lastEx != null) { - ( - ( - it.name.substringBefore( - ". Глава", - ).toIntOrNull()!! <= - (lastEx.name.substringBefore(". Глава").toIntOrNull()!!) - ) && - (it.chapter_number < lastEx.chapter_number) - ) + val lastEx = tempChaptersList.find { !it.name.contains("\uD83D\uDCB2") } + tempChaptersList.filterNot { + it.name.contains("\uD83D\uDCB2") && if (lastEx != null) { + val volCor = it.name.substringBefore( + ". Глава", + ).toIntOrNull()!! + val volLast = lastEx.name.substringBefore(". Глава").toIntOrNull()!! + (volCor > volLast) || + ((volCor == volLast) && (it.chapter_number > lastEx.chapter_number)) } else { false }