remove dead delegatedsources (#701)
This commit is contained in:
@@ -38,7 +38,6 @@ import eu.kanade.tachiyomi.network.NetworkPreferences
|
||||
import eu.kanade.tachiyomi.network.PREF_DOH_CLOUDFLARE
|
||||
import eu.kanade.tachiyomi.source.Source
|
||||
import eu.kanade.tachiyomi.source.SourceManager
|
||||
import eu.kanade.tachiyomi.source.online.all.Hitomi
|
||||
import eu.kanade.tachiyomi.source.online.all.NHentai
|
||||
import eu.kanade.tachiyomi.ui.reader.setting.OrientationType
|
||||
import eu.kanade.tachiyomi.ui.reader.setting.ReaderPreferences
|
||||
@@ -54,8 +53,6 @@ import exh.source.BlacklistedSources
|
||||
import exh.source.EH_SOURCE_ID
|
||||
import exh.source.HBROWSE_SOURCE_ID
|
||||
import exh.source.MERGED_SOURCE_ID
|
||||
import exh.source.PERV_EDEN_EN_SOURCE_ID
|
||||
import exh.source.PERV_EDEN_IT_SOURCE_ID
|
||||
import exh.source.TSUMINO_SOURCE_ID
|
||||
import exh.util.nullIfBlank
|
||||
import exh.util.under
|
||||
@@ -139,13 +136,7 @@ object EXHMigrations {
|
||||
updateManga.awaitAll(mangaUpdates)
|
||||
}
|
||||
}
|
||||
if (oldVersion under 5) {
|
||||
// Migrate Hitomi source IDs
|
||||
updateSourceId(Hitomi.otherId, 6910)
|
||||
}
|
||||
if (oldVersion under 6) {
|
||||
updateSourceId(PERV_EDEN_EN_SOURCE_ID, 6905)
|
||||
updateSourceId(PERV_EDEN_IT_SOURCE_ID, 6906)
|
||||
updateSourceId(NHentai.otherId, 6907)
|
||||
}
|
||||
if (oldVersion under 7) {
|
||||
@@ -518,14 +509,6 @@ object EXHMigrations {
|
||||
}
|
||||
|
||||
fun migrateBackupEntry(manga: Manga) {
|
||||
if (manga.source == 6905L) {
|
||||
manga.source = PERV_EDEN_EN_SOURCE_ID
|
||||
}
|
||||
|
||||
if (manga.source == 6906L) {
|
||||
manga.source = PERV_EDEN_IT_SOURCE_ID
|
||||
}
|
||||
|
||||
if (manga.source == 6907L) {
|
||||
// Migrate the old source to the delegated one
|
||||
manga.source = NHentai.otherId
|
||||
@@ -538,10 +521,6 @@ object EXHMigrations {
|
||||
manga.source = TSUMINO_SOURCE_ID
|
||||
}
|
||||
|
||||
if (manga.source == 6910L) {
|
||||
manga.source = Hitomi.otherId
|
||||
}
|
||||
|
||||
if (manga.source == 6912L) {
|
||||
manga.source = HBROWSE_SOURCE_ID
|
||||
manga.url = manga.url + "/c00001/"
|
||||
|
||||
@@ -3,10 +3,8 @@ package exh.source
|
||||
import eu.kanade.tachiyomi.data.database.models.Manga
|
||||
import eu.kanade.tachiyomi.source.Source
|
||||
import eu.kanade.tachiyomi.source.SourceManager
|
||||
import eu.kanade.tachiyomi.source.online.all.Hitomi
|
||||
import eu.kanade.tachiyomi.source.online.all.MangaDex
|
||||
import eu.kanade.tachiyomi.source.online.all.NHentai
|
||||
import eu.kanade.tachiyomi.source.online.all.PervEden
|
||||
import eu.kanade.tachiyomi.source.online.english.EightMuses
|
||||
import eu.kanade.tachiyomi.source.online.english.HBrowse
|
||||
import eu.kanade.tachiyomi.source.online.english.Pururin
|
||||
@@ -21,8 +19,6 @@ import eu.kanade.domain.manga.model.Manga as DomainManga
|
||||
const val LEWD_SOURCE_SERIES = 6900L
|
||||
const val EH_SOURCE_ID = LEWD_SOURCE_SERIES + 1
|
||||
const val EXH_SOURCE_ID = LEWD_SOURCE_SERIES + 2
|
||||
const val PERV_EDEN_EN_SOURCE_ID = 4673633799850248749
|
||||
const val PERV_EDEN_IT_SOURCE_ID = 1433898225963724122
|
||||
const val PURURIN_SOURCE_ID = 2221515250486218861
|
||||
const val TSUMINO_SOURCE_ID = 6707338697138388238
|
||||
const val EIGHTMUSES_SOURCE_ID = 1802675169972965535
|
||||
@@ -35,8 +31,6 @@ private val DELEGATED_METADATA_SOURCES by lazy {
|
||||
Tsumino::class,
|
||||
HBrowse::class,
|
||||
EightMuses::class,
|
||||
Hitomi::class,
|
||||
PervEden::class,
|
||||
NHentai::class,
|
||||
)
|
||||
}
|
||||
@@ -44,8 +38,6 @@ private val DELEGATED_METADATA_SOURCES by lazy {
|
||||
// Used to speed up isLewdSource
|
||||
var metadataDelegatedSourceIds: List<Long> = emptyList()
|
||||
|
||||
var hitomiSourceIds: List<Long> = emptyList()
|
||||
|
||||
var nHentaiSourceIds: List<Long> = emptyList()
|
||||
|
||||
var mangaDexSourceIds: List<Long> = emptyList()
|
||||
@@ -64,13 +56,6 @@ fun handleSourceLibrary() {
|
||||
.map { it.value.sourceId }
|
||||
.sorted()
|
||||
|
||||
hitomiSourceIds = SourceManager.currentDelegatedSources
|
||||
.filter {
|
||||
it.value.newSourceClass == Hitomi::class
|
||||
}
|
||||
.map { it.value.sourceId }
|
||||
.sorted()
|
||||
|
||||
nHentaiSourceIds = SourceManager.currentDelegatedSources
|
||||
.filter {
|
||||
it.value.newSourceClass == NHentai::class
|
||||
@@ -89,7 +74,7 @@ fun handleSourceLibrary() {
|
||||
EH_SOURCE_ID,
|
||||
EXH_SOURCE_ID,
|
||||
PURURIN_SOURCE_ID,
|
||||
) + hitomiSourceIds + nHentaiSourceIds
|
||||
) + nHentaiSourceIds
|
||||
}
|
||||
|
||||
// This method MUST be fast!
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
package exh.ui.metadata.adapters
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.viewinterop.AndroidView
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.databinding.DescriptionAdapterHiBinding
|
||||
import eu.kanade.tachiyomi.ui.manga.MangaScreenState
|
||||
import eu.kanade.tachiyomi.util.system.copyToClipboard
|
||||
import exh.metadata.MetadataUtil
|
||||
import exh.metadata.metadata.HitomiSearchMetadata
|
||||
import exh.ui.metadata.adapters.MetadataUIUtil.bindDrawable
|
||||
import java.util.Date
|
||||
|
||||
@Composable
|
||||
fun HitomiDescription(state: MangaScreenState.Success, openMetadataViewer: () -> Unit) {
|
||||
val context = LocalContext.current
|
||||
AndroidView(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
factory = { factoryContext ->
|
||||
DescriptionAdapterHiBinding.inflate(LayoutInflater.from(factoryContext)).root
|
||||
},
|
||||
update = {
|
||||
val meta = state.meta
|
||||
if (meta == null || meta !is HitomiSearchMetadata) return@AndroidView
|
||||
val binding = DescriptionAdapterHiBinding.bind(it)
|
||||
|
||||
binding.genre.text = meta.genre?.let { MetadataUIUtil.getGenreAndColour(context, it) }?.let {
|
||||
binding.genre.setBackgroundColor(it.first)
|
||||
it.second
|
||||
} ?: meta.genre ?: context.getString(R.string.unknown)
|
||||
|
||||
binding.whenPosted.text = MetadataUtil.EX_DATE_FORMAT.format(Date(meta.uploadDate ?: 0))
|
||||
binding.language.text = meta.language ?: context.getString(R.string.unknown)
|
||||
|
||||
binding.moreInfo.bindDrawable(context, R.drawable.ic_info_24dp)
|
||||
|
||||
listOf(
|
||||
binding.genre,
|
||||
binding.language,
|
||||
binding.whenPosted,
|
||||
).forEach { textView ->
|
||||
textView.setOnLongClickListener {
|
||||
context.copyToClipboard(
|
||||
textView.text.toString(),
|
||||
textView.text.toString(),
|
||||
)
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
binding.moreInfo.setOnClickListener {
|
||||
openMetadataViewer()
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
package exh.ui.metadata.adapters
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.view.LayoutInflater
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.viewinterop.AndroidView
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.databinding.DescriptionAdapterPeBinding
|
||||
import eu.kanade.tachiyomi.ui.manga.MangaScreenState
|
||||
import eu.kanade.tachiyomi.util.system.copyToClipboard
|
||||
import exh.metadata.metadata.PervEdenSearchMetadata
|
||||
import exh.ui.metadata.adapters.MetadataUIUtil.bindDrawable
|
||||
import java.util.Locale
|
||||
import kotlin.math.round
|
||||
|
||||
@Composable
|
||||
fun PervEdenDescription(state: MangaScreenState.Success, openMetadataViewer: () -> Unit) {
|
||||
val context = LocalContext.current
|
||||
AndroidView(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
factory = { factoryContext ->
|
||||
DescriptionAdapterPeBinding.inflate(LayoutInflater.from(factoryContext)).root
|
||||
},
|
||||
update = {
|
||||
val meta = state.meta
|
||||
if (meta == null || meta !is PervEdenSearchMetadata) return@AndroidView
|
||||
val binding = DescriptionAdapterPeBinding.bind(it)
|
||||
|
||||
binding.genre.text = meta.genre?.let { MetadataUIUtil.getGenreAndColour(context, it) }?.let {
|
||||
binding.genre.setBackgroundColor(it.first)
|
||||
it.second
|
||||
} ?: meta.genre ?: context.getString(R.string.unknown)
|
||||
|
||||
val language = meta.lang
|
||||
binding.language.text = if (language != null) {
|
||||
val local = Locale(language)
|
||||
local.displayName
|
||||
} else {
|
||||
context.getString(R.string.unknown)
|
||||
}
|
||||
|
||||
binding.ratingBar.rating = meta.rating ?: 0F
|
||||
@SuppressLint("SetTextI18n")
|
||||
binding.rating.text = (round((meta.rating ?: 0F) * 100.0) / 100.0).toString() + " - " + MetadataUIUtil.getRatingString(context, meta.rating?.times(2))
|
||||
|
||||
binding.moreInfo.bindDrawable(context, R.drawable.ic_info_24dp)
|
||||
|
||||
listOf(
|
||||
binding.genre,
|
||||
binding.language,
|
||||
binding.rating,
|
||||
).forEach { textView ->
|
||||
textView.setOnLongClickListener {
|
||||
context.copyToClipboard(
|
||||
textView.text.toString(),
|
||||
textView.text.toString(),
|
||||
)
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
binding.moreInfo.setOnClickListener {
|
||||
openMetadataViewer()
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
@@ -48,7 +48,6 @@ private fun isHentaiSource(source: String): Boolean {
|
||||
source.contains("pururin", true) ||
|
||||
source.contains("simply hentai", true) ||
|
||||
source.contains("tsumino", true) ||
|
||||
source.contains("hitomi.la", true) ||
|
||||
source.contains("8muses", true) ||
|
||||
source.contains("hbrowse", true) ||
|
||||
source.contains("nhentai", true) ||
|
||||
|
||||
@@ -6,7 +6,6 @@ import exh.source.EH_SOURCE_ID
|
||||
import exh.source.EXH_SOURCE_ID
|
||||
import exh.source.PURURIN_SOURCE_ID
|
||||
import exh.source.TSUMINO_SOURCE_ID
|
||||
import exh.source.hitomiSourceIds
|
||||
import exh.source.mangaDexSourceIds
|
||||
import exh.source.nHentaiSourceIds
|
||||
import java.util.Locale
|
||||
@@ -22,7 +21,6 @@ object SourceTagsUtil {
|
||||
sourceId == EXH_SOURCE_ID ||
|
||||
sourceId == EH_SOURCE_ID ||
|
||||
sourceId in nHentaiSourceIds ||
|
||||
sourceId in hitomiSourceIds ||
|
||||
sourceId in mangaDexSourceIds ||
|
||||
sourceId == PURURIN_SOURCE_ID ||
|
||||
sourceId == TSUMINO_SOURCE_ID
|
||||
@@ -34,7 +32,6 @@ object SourceTagsUtil {
|
||||
}
|
||||
if (parsed?.namespace != null) {
|
||||
when (sourceId) {
|
||||
in hitomiSourceIds -> wrapTagHitomi(parsed.namespace!!, parsed.name.substringBefore('|').trim())
|
||||
in nHentaiSourceIds -> wrapTagNHentai(parsed.namespace!!, parsed.name.substringBefore('|').trim())
|
||||
in mangaDexSourceIds -> parsed.name
|
||||
PURURIN_SOURCE_ID -> parsed.name.substringBefore('|').trim()
|
||||
@@ -55,12 +52,6 @@ object SourceTagsUtil {
|
||||
"$namespace:$tag$"
|
||||
}
|
||||
|
||||
private fun wrapTagHitomi(namespace: String, tag: String) = if (tag.contains(spaceRegex)) {
|
||||
"$namespace:$tag".replace("\\s".toRegex(), "_")
|
||||
} else {
|
||||
"$namespace:$tag"
|
||||
}
|
||||
|
||||
private fun wrapTagNHentai(namespace: String, tag: String) = if (tag.contains(spaceRegex)) {
|
||||
if (namespace == "tag") {
|
||||
""""$tag""""
|
||||
|
||||
Reference in New Issue
Block a user