mirror of
https://github.com/tachiyomiorg/tachiyomi-extensions-inspector.git
synced 2025-01-13 01:09:09 +01:00
Add hasCloudflare and versionId to output json (#7)
This commit is contained in:
parent
556da6a0b1
commit
64aebe5416
@ -8,6 +8,7 @@ package suwayomi.tachidesk
|
|||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import eu.kanade.tachiyomi.network.interceptor.CloudflareInterceptor
|
||||||
import eu.kanade.tachiyomi.source.online.HttpSource
|
import eu.kanade.tachiyomi.source.online.HttpSource
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
import kotlinx.serialization.encodeToString
|
import kotlinx.serialization.encodeToString
|
||||||
@ -54,13 +55,21 @@ data class SourceJson(
|
|||||||
val name: String,
|
val name: String,
|
||||||
val lang: String,
|
val lang: String,
|
||||||
val id: String,
|
val id: String,
|
||||||
val baseUrl: String
|
val baseUrl: String,
|
||||||
|
val versionId: Int,
|
||||||
|
val hasCloudflare: Short
|
||||||
) {
|
) {
|
||||||
constructor(source: HttpSource) :
|
constructor(source: HttpSource) :
|
||||||
this(
|
this(
|
||||||
source.name,
|
source.name,
|
||||||
source.lang,
|
source.lang,
|
||||||
source.id.toString(),
|
source.id.toString(),
|
||||||
source.baseUrl
|
source.baseUrl,
|
||||||
|
source.versionId,
|
||||||
|
source.client.interceptors
|
||||||
|
.any { it is CloudflareInterceptor }
|
||||||
|
.toShort()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun Boolean.toShort(): Short = if (this) 1 else 0
|
Loading…
x
Reference in New Issue
Block a user