Remove date logic checks based on vanilla version (#15951)
* Remove date logic checks based on vanilla version * SixMH: baseUrl for CI
This commit is contained in:
parent
68e63e408a
commit
f2321f698b
|
@ -9,7 +9,7 @@ import org.jsoup.nodes.Document
|
|||
import rx.Observable
|
||||
import rx.Single
|
||||
|
||||
class Gufengmh : SinMH("古风漫画网", "https://www.123gf.com") {
|
||||
class Gufengmh : SinMH("古风漫画网", "https://www.gufengmh.com") {
|
||||
|
||||
override fun mangaDetailsParse(document: Document): SManga =
|
||||
super.mangaDetailsParse(document).apply {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package eu.kanade.tachiyomi.multisrc.sinmh
|
||||
|
||||
import eu.kanade.tachiyomi.AppInfo
|
||||
import eu.kanade.tachiyomi.network.GET
|
||||
import eu.kanade.tachiyomi.network.interceptor.rateLimit
|
||||
import eu.kanade.tachiyomi.source.model.Filter
|
||||
|
@ -166,7 +165,7 @@ abstract class SinMH(
|
|||
val list = document.select(sectionSelector).sectionsDescending().flatMap { section ->
|
||||
section.select(itemSelector).map { chapterFromElement(it) }.sortedDescending()
|
||||
}
|
||||
if (isNewDateLogic && list.isNotEmpty()) {
|
||||
if (list.isNotEmpty()) {
|
||||
val date = document.selectFirst(dateSelector)!!.textNodes().last().text()
|
||||
list[0].date_upload = DATE_FORMAT.parse(date)?.time ?: 0L
|
||||
}
|
||||
|
@ -267,7 +266,6 @@ abstract class SinMH(
|
|||
|
||||
companion object {
|
||||
private val DATE_FORMAT by lazy { SimpleDateFormat("yyyy-MM-dd", Locale.ENGLISH) }
|
||||
private val isNewDateLogic = AppInfo.getVersionCode() >= 81
|
||||
private val sortNames = arrayOf("按发布排序", "按发布排序(逆序)", "按更新排序", "按更新排序(逆序)", "按点击排序", "按点击排序(逆序)")
|
||||
private val sortKeys = arrayOf("post/", "-post/", "update/", "-update/", "click/", "-click/")
|
||||
}
|
||||
|
|
|
@ -6,11 +6,11 @@ import generator.ThemeSourceGenerator
|
|||
class SinMHGenerator : ThemeSourceGenerator {
|
||||
override val themeClass = "SinMH"
|
||||
override val themePkg = "sinmh"
|
||||
override val baseVersionCode = 8
|
||||
override val baseVersionCode = 9
|
||||
override val sources = listOf(
|
||||
SingleLang(
|
||||
name = "Gufeng Manhua",
|
||||
baseUrl = "https://www.123gf.com",
|
||||
baseUrl = "https://www.gufengmh.com",
|
||||
lang = "zh",
|
||||
className = "Gufengmh",
|
||||
sourceName = "古风漫画网",
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
## 1.3.19 (2023-04-03)
|
||||
|
||||
- 设置章节日期时不再错误地检查应用版本
|
||||
|
||||
## 1.3.18 (2023-01-12)
|
||||
|
||||
- 修复繁体站点章节列表错乱的问题
|
||||
|
|
|
@ -5,7 +5,7 @@ ext {
|
|||
extName = 'Baozi Manhua'
|
||||
pkgNameSuffix = 'zh.baozimanhua'
|
||||
extClass = '.Baozi'
|
||||
extVersionCode = 18
|
||||
extVersionCode = 19
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
|
|
@ -5,7 +5,6 @@ import android.content.SharedPreferences
|
|||
import androidx.preference.ListPreference
|
||||
import androidx.preference.PreferenceScreen
|
||||
import com.github.stevenyomi.baozibanner.BaoziBanner
|
||||
import eu.kanade.tachiyomi.AppInfo
|
||||
import eu.kanade.tachiyomi.network.GET
|
||||
import eu.kanade.tachiyomi.network.asObservableSuccess
|
||||
import eu.kanade.tachiyomi.network.interceptor.rateLimit
|
||||
|
@ -77,7 +76,6 @@ class Baozi : ParsedHttpSource(), ConfigurableSource {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (!isNewDateLogic) return@apply
|
||||
val date = document.select("em").text()
|
||||
if (date.contains('年')) {
|
||||
this[0].date_upload = date.removePrefix("(").removeSuffix(" 更新)")
|
||||
|
@ -282,6 +280,5 @@ class Baozi : ParsedHttpSource(), ConfigurableSource {
|
|||
private const val CHAPTER_ORDER_AGGRESSIVE = "2"
|
||||
|
||||
private val DATE_FORMAT by lazy { SimpleDateFormat("yyyy年MM月dd日", Locale.ENGLISH) }
|
||||
private val isNewDateLogic = AppInfo.getVersionCode() >= 81
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ ext {
|
|||
extName = 'Roumanwu'
|
||||
pkgNameSuffix = 'zh.roumanwu'
|
||||
extClass = '.Roumanwu'
|
||||
extVersionCode = 3
|
||||
extVersionCode = 4
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package eu.kanade.tachiyomi.extension.zh.roumanwu
|
||||
|
||||
import eu.kanade.tachiyomi.AppInfo
|
||||
import eu.kanade.tachiyomi.source.model.MangasPage
|
||||
import eu.kanade.tachiyomi.source.model.Page
|
||||
import eu.kanade.tachiyomi.source.model.SChapter
|
||||
|
@ -46,7 +45,7 @@ data class Book(
|
|||
name = it
|
||||
}
|
||||
}.apply {
|
||||
if (isNewDateLogic && !updatedAt.isNullOrBlank()) {
|
||||
if (!updatedAt.isNullOrBlank()) {
|
||||
this[lastIndex].date_upload = DATE_FORMAT.parse(updatedAt)?.time ?: 0L
|
||||
}
|
||||
}
|
||||
|
@ -57,16 +56,6 @@ data class Book(
|
|||
|
||||
companion object {
|
||||
private val DATE_FORMAT = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.ENGLISH)
|
||||
private val isNewDateLogic = run {
|
||||
val commitCount = AppInfo.getVersionName().substringAfter('-', "")
|
||||
if (commitCount.isNotEmpty()) {
|
||||
// Preview
|
||||
commitCount.toInt() >= 4442
|
||||
} else {
|
||||
// Stable
|
||||
AppInfo.getVersionCode() >= 81
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ ext {
|
|||
extName = '6Manhua / Qixi Manhua'
|
||||
pkgNameSuffix = 'zh.sixmh'
|
||||
extClass = '.SixMH'
|
||||
extVersionCode = 7
|
||||
extVersionCode = 8
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
|
|
@ -3,7 +3,6 @@ package eu.kanade.tachiyomi.extension.zh.sixmh
|
|||
import android.app.Application
|
||||
import androidx.preference.ListPreference
|
||||
import androidx.preference.PreferenceScreen
|
||||
import eu.kanade.tachiyomi.AppInfo
|
||||
import eu.kanade.tachiyomi.lib.unpacker.Unpacker
|
||||
import eu.kanade.tachiyomi.network.GET
|
||||
import eu.kanade.tachiyomi.network.POST
|
||||
|
@ -37,9 +36,15 @@ class SixMH : HttpSource(), ConfigurableSource {
|
|||
override val lang = "zh"
|
||||
override val supportsLatest = true
|
||||
|
||||
private val isCi = System.getenv("CI") == "true"
|
||||
override val baseUrl get() = when {
|
||||
isCi -> MIRRORS.zip(MIRROR_NAMES) { domain, name -> "http://www.$domain#$name" }.joinToString()
|
||||
else -> _baseUrl
|
||||
}
|
||||
|
||||
private val mirrorIndex: Int
|
||||
private val pcUrl: String
|
||||
override val baseUrl: String
|
||||
private val _baseUrl: String
|
||||
|
||||
init {
|
||||
val preferences = Injekt.get<Application>().getSharedPreferences("source_$id", 0x0000)
|
||||
|
@ -53,7 +58,7 @@ class SixMH : HttpSource(), ConfigurableSource {
|
|||
|
||||
mirrorIndex = index
|
||||
pcUrl = "http://www.$domain"
|
||||
baseUrl = "http://$domain"
|
||||
_baseUrl = "http://$domain"
|
||||
}
|
||||
|
||||
private val json: Json by injectLazy()
|
||||
|
@ -164,7 +169,7 @@ class SixMH : HttpSource(), ConfigurableSource {
|
|||
}
|
||||
}
|
||||
|
||||
if (isNewDateLogic && list.isNotEmpty()) {
|
||||
if (list.isNotEmpty()) {
|
||||
document.selectFirst(".cy_zhangjie_top font")?.run {
|
||||
list[0].date_upload = dateFormat.parse(ownText())?.time ?: 0
|
||||
}
|
||||
|
@ -211,7 +216,6 @@ class SixMH : HttpSource(), ConfigurableSource {
|
|||
val MIRRORS get() = arrayOf("6mh67.com", "qiximh3.com")
|
||||
val MIRROR_NAMES get() = arrayOf("6漫画", "七夕漫画")
|
||||
|
||||
private val isNewDateLogic = AppInfo.getVersionCode() >= 81
|
||||
private val dateFormat by lazy { SimpleDateFormat("yyyy-MM-dd", Locale.ENGLISH) }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ ext {
|
|||
extName = 'Terra Historicus'
|
||||
pkgNameSuffix = 'zh.terrahistoricus'
|
||||
extClass = '.TerraHistoricus'
|
||||
extVersionCode = 2
|
||||
extVersionCode = 3
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package eu.kanade.tachiyomi.extension.zh.terrahistoricus
|
||||
|
||||
import eu.kanade.tachiyomi.AppInfo
|
||||
import eu.kanade.tachiyomi.source.model.SChapter
|
||||
import eu.kanade.tachiyomi.source.model.SManga
|
||||
import kotlinx.serialization.Serializable
|
||||
|
@ -57,23 +56,11 @@ data class THComic(
|
|||
}
|
||||
}
|
||||
}.apply {
|
||||
if (isNewDateLogic) {
|
||||
this[0].date_upload = (updateTime ?: 0L) * 1000
|
||||
}
|
||||
this[0].date_upload = (updateTime ?: 0L) * 1000
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val EPISODE_TYPES = arrayOf("", "正篇", "番外", "贺图", "公告")
|
||||
private val isNewDateLogic = run {
|
||||
val commitCount = AppInfo.getVersionName().substringAfter('-', "")
|
||||
if (commitCount.isNotEmpty()) {
|
||||
// Preview
|
||||
commitCount.toInt() >= 4442
|
||||
} else {
|
||||
// Stable
|
||||
AppInfo.getVersionCode() >= 81
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue