mirror of
https://github.com/tachiyomiorg/tachiyomi-extensions-inspector.git
synced 2025-01-12 16:59:08 +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/.
|
||||
*/
|
||||
|
||||
import eu.kanade.tachiyomi.network.interceptor.CloudflareInterceptor
|
||||
import eu.kanade.tachiyomi.source.online.HttpSource
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.encodeToString
|
||||
@ -54,13 +55,21 @@ data class SourceJson(
|
||||
val name: String,
|
||||
val lang: String,
|
||||
val id: String,
|
||||
val baseUrl: String
|
||||
val baseUrl: String,
|
||||
val versionId: Int,
|
||||
val hasCloudflare: Short
|
||||
) {
|
||||
constructor(source: HttpSource) :
|
||||
this(
|
||||
source.name,
|
||||
source.lang,
|
||||
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