Fix an issue that the "change CDN" option was incorrectly handled (#9085)

This commit is contained in:
SnowArk 2021-09-16 21:29:25 +08:00 committed by GitHub
parent d8bcdd11c7
commit 84e6ca5764
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'CopyManga'
pkgNameSuffix = 'zh.copymanga'
extClass = '.CopyManga'
extVersionCode = 12
extVersionCode = 13
}
apply from: "$rootDir/common.gradle"

View File

@ -112,7 +112,7 @@ class CopyManga : ConfigurableSource, HttpSource() {
val manga = SManga.create().apply {
title = _title
var picture = document.select("div.comicParticulars-title-left img").first().attr("data-src")
if (!preferences.getBoolean(change_cdn_tomainland, false)) {
if (preferences.getBoolean(change_cdn_tomainland, false)) {
picture = replaceToMirror2.replace(picture, "mirror2.mangafunc.fun")
picture = replaceToMirror.replace(picture, "mirror.mangafunc.fun")
}
@ -197,7 +197,7 @@ class CopyManga : ConfigurableSource, HttpSource() {
val ret = ArrayList<Page>(pageArray.length())
for (i in 0 until pageArray.length()) {
var page = pageArray.getJSONObject(i).getString("url")
if (!preferences.getBoolean(change_cdn_tomainland, false)) {
if (preferences.getBoolean(change_cdn_tomainland, false)) {
page = replaceToMirror2.replace(page, "mirror2.mangafunc.fun")
page = replaceToMirror.replace(page, "mirror.mangafunc.fun")
}
@ -339,7 +339,7 @@ class CopyManga : ConfigurableSource, HttpSource() {
SManga.create().apply {
title = _title
var picture = obj.getString("cover")
if (!preferences.getBoolean(change_cdn_tomainland, false)) {
if (preferences.getBoolean(change_cdn_tomainland, false)) {
picture = replaceToMirror2.replace(picture, "mirror2.mangafunc.fun")
picture = replaceToMirror.replace(picture, "mirror.mangafunc.fun")
}
@ -358,7 +358,7 @@ class CopyManga : ConfigurableSource, HttpSource() {
val manga = SManga.create()
element.select("div.exemptComicItem-img > a > img").first().let {
var picture = it.attr("data-src")
if (!preferences.getBoolean(change_cdn_tomainland, false)) {
if (preferences.getBoolean(change_cdn_tomainland, false)) {
picture = replaceToMirror2.replace(picture, "mirror2.mangafunc.fun")
picture = replaceToMirror.replace(picture, "mirror.mangafunc.fun")
}