remove dead delegatedsources (#701)
This commit is contained in:
@@ -9,8 +9,6 @@ import eu.kanade.domain.category.model.Category
|
||||
import eu.kanade.domain.library.model.LibraryGroup
|
||||
import eu.kanade.domain.library.model.LibraryManga
|
||||
import eu.kanade.tachiyomi.ui.library.LibraryPresenter
|
||||
import exh.source.PERV_EDEN_EN_SOURCE_ID
|
||||
import exh.source.PERV_EDEN_IT_SOURCE_ID
|
||||
import exh.source.isEhBasedManga
|
||||
import exh.source.mangaDexSourceIds
|
||||
import exh.source.nHentaiSourceIds
|
||||
@@ -56,9 +54,7 @@ class LibraryStateImpl : LibraryState {
|
||||
override val showCleanTitles: Boolean by derivedStateOf {
|
||||
selection.any {
|
||||
it.manga.isEhBasedManga() ||
|
||||
it.manga.source in nHentaiSourceIds ||
|
||||
it.manga.source == PERV_EDEN_EN_SOURCE_ID ||
|
||||
it.manga.source == PERV_EDEN_IT_SOURCE_ID
|
||||
it.manga.source in nHentaiSourceIds
|
||||
}
|
||||
}
|
||||
override val showAddToMangadex: Boolean by derivedStateOf {
|
||||
|
||||
@@ -76,10 +76,8 @@ import eu.kanade.tachiyomi.source.SourceManager
|
||||
import eu.kanade.tachiyomi.source.getNameForMangaInfo
|
||||
import eu.kanade.tachiyomi.source.online.MetadataSource
|
||||
import eu.kanade.tachiyomi.source.online.all.EHentai
|
||||
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
|
||||
@@ -92,10 +90,8 @@ import exh.source.getMainSource
|
||||
import exh.ui.metadata.adapters.EHentaiDescription
|
||||
import exh.ui.metadata.adapters.EightMusesDescription
|
||||
import exh.ui.metadata.adapters.HBrowseDescription
|
||||
import exh.ui.metadata.adapters.HitomiDescription
|
||||
import exh.ui.metadata.adapters.MangaDexDescription
|
||||
import exh.ui.metadata.adapters.NHentaiDescription
|
||||
import exh.ui.metadata.adapters.PervEdenDescription
|
||||
import exh.ui.metadata.adapters.PururinDescription
|
||||
import exh.ui.metadata.adapters.TsuminoDescription
|
||||
|
||||
@@ -873,18 +869,12 @@ fun metadataDescription(source: Source): MetadataDescriptionComposable? {
|
||||
is EHentai -> { state, openMetadataViewer, search ->
|
||||
EHentaiDescription(state, openMetadataViewer, search)
|
||||
}
|
||||
is Hitomi -> { state, openMetadataViewer, _ ->
|
||||
HitomiDescription(state, openMetadataViewer)
|
||||
}
|
||||
is MangaDex -> { state, openMetadataViewer, _ ->
|
||||
MangaDexDescription(state, openMetadataViewer)
|
||||
}
|
||||
is NHentai -> { state, openMetadataViewer, _ ->
|
||||
NHentaiDescription(state, openMetadataViewer)
|
||||
}
|
||||
is PervEden -> { state, openMetadataViewer, _ ->
|
||||
PervEdenDescription(state, openMetadataViewer)
|
||||
}
|
||||
is EightMuses -> { state, openMetadataViewer, _ ->
|
||||
EightMusesDescription(state, openMetadataViewer)
|
||||
}
|
||||
|
||||
@@ -12,11 +12,9 @@ import eu.kanade.tachiyomi.source.model.SChapter
|
||||
import eu.kanade.tachiyomi.source.model.SManga
|
||||
import eu.kanade.tachiyomi.source.online.HttpSource
|
||||
import eu.kanade.tachiyomi.source.online.all.EHentai
|
||||
import eu.kanade.tachiyomi.source.online.all.Hitomi
|
||||
import eu.kanade.tachiyomi.source.online.all.MangaDex
|
||||
import eu.kanade.tachiyomi.source.online.all.MergedSource
|
||||
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
|
||||
@@ -30,8 +28,6 @@ import exh.source.EXH_SOURCE_ID
|
||||
import exh.source.EnhancedHttpSource
|
||||
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.PURURIN_SOURCE_ID
|
||||
import exh.source.TSUMINO_SOURCE_ID
|
||||
import exh.source.handleSourceLibrary
|
||||
@@ -292,25 +288,6 @@ class SourceManager(
|
||||
"eu.kanade.tachiyomi.extension.en.eightmuses.EightMuses",
|
||||
EightMuses::class,
|
||||
),
|
||||
DelegatedSource(
|
||||
"Hitomi",
|
||||
fillInSourceId,
|
||||
"eu.kanade.tachiyomi.extension.all.hitomi.Hitomi",
|
||||
Hitomi::class,
|
||||
true,
|
||||
),
|
||||
DelegatedSource(
|
||||
"PervEden English",
|
||||
PERV_EDEN_EN_SOURCE_ID,
|
||||
"eu.kanade.tachiyomi.extension.en.perveden.Perveden",
|
||||
PervEden::class,
|
||||
),
|
||||
DelegatedSource(
|
||||
"PervEden Italian",
|
||||
PERV_EDEN_IT_SOURCE_ID,
|
||||
"eu.kanade.tachiyomi.extension.it.perveden.Perveden",
|
||||
PervEden::class,
|
||||
),
|
||||
DelegatedSource(
|
||||
"NHentai",
|
||||
fillInSourceId,
|
||||
|
||||
@@ -1,146 +0,0 @@
|
||||
package eu.kanade.tachiyomi.source.online.all
|
||||
|
||||
import android.content.Context
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import eu.kanade.tachiyomi.network.await
|
||||
import eu.kanade.tachiyomi.source.model.FilterList
|
||||
import eu.kanade.tachiyomi.source.model.SManga
|
||||
import eu.kanade.tachiyomi.source.online.HttpSource
|
||||
import eu.kanade.tachiyomi.source.online.MetadataSource
|
||||
import eu.kanade.tachiyomi.source.online.NamespaceSource
|
||||
import eu.kanade.tachiyomi.source.online.UrlImportableSource
|
||||
import eu.kanade.tachiyomi.util.asJsoup
|
||||
import exh.metadata.metadata.HitomiSearchMetadata
|
||||
import exh.metadata.metadata.base.RaisedSearchMetadata
|
||||
import exh.metadata.metadata.base.RaisedTag
|
||||
import exh.source.DelegatedHttpSource
|
||||
import exh.util.urlImportFetchSearchManga
|
||||
import org.jsoup.nodes.Document
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Locale
|
||||
|
||||
class Hitomi(delegate: HttpSource, val context: Context) :
|
||||
DelegatedHttpSource(delegate),
|
||||
MetadataSource<HitomiSearchMetadata, Document>,
|
||||
UrlImportableSource,
|
||||
NamespaceSource {
|
||||
override val metaClass = HitomiSearchMetadata::class
|
||||
override val lang = delegate.lang
|
||||
|
||||
// Support direct URL importing
|
||||
override fun fetchSearchManga(page: Int, query: String, filters: FilterList) =
|
||||
urlImportFetchSearchManga(context, query) {
|
||||
super.fetchSearchManga(page, query, filters)
|
||||
}
|
||||
|
||||
override suspend fun getMangaDetails(manga: SManga): SManga {
|
||||
val response = client.newCall(mangaDetailsRequest(manga)).await()
|
||||
return parseToManga(manga, response.asJsoup())
|
||||
}
|
||||
|
||||
override suspend fun parseIntoMetadata(metadata: HitomiSearchMetadata, input: Document) {
|
||||
with(metadata) {
|
||||
url = input.location()
|
||||
|
||||
tags.clear()
|
||||
|
||||
thumbnailUrl = "https:" + input.selectFirst(".cover img")!!.attr("src")
|
||||
|
||||
val galleryElement = input.selectFirst(".gallery")!!
|
||||
|
||||
title = galleryElement.selectFirst("h1")!!.text()
|
||||
artists = galleryElement.select("h2 a").map { it.text() }
|
||||
tags += artists.map { RaisedTag("artist", it, HitomiSearchMetadata.TAG_TYPE_DEFAULT) }
|
||||
|
||||
input.select(".gallery-info tr").forEach { galleryInfoElement ->
|
||||
val content = galleryInfoElement.child(1)
|
||||
when (galleryInfoElement.child(0).text().lowercase()) {
|
||||
"group" -> {
|
||||
val group = content.text()
|
||||
tags += RaisedTag(
|
||||
"group",
|
||||
group,
|
||||
if (group != "N/A") {
|
||||
HitomiSearchMetadata.TAG_TYPE_DEFAULT
|
||||
} else {
|
||||
RaisedSearchMetadata.TAG_TYPE_VIRTUAL
|
||||
},
|
||||
)
|
||||
}
|
||||
"type" -> {
|
||||
genre = content.text()
|
||||
tags += RaisedTag("genre", genre!!, RaisedSearchMetadata.TAG_TYPE_VIRTUAL)
|
||||
}
|
||||
"series" -> {
|
||||
val series = content.select("a").map { it.text() }
|
||||
tags += series.map {
|
||||
RaisedTag("series", it, HitomiSearchMetadata.TAG_TYPE_DEFAULT)
|
||||
}
|
||||
}
|
||||
"language" -> {
|
||||
language = content.selectFirst("a")?.attr("href")?.split('-')?.get(1)
|
||||
language?.let {
|
||||
tags += RaisedTag("language", it, RaisedSearchMetadata.TAG_TYPE_VIRTUAL)
|
||||
}
|
||||
}
|
||||
"characters" -> {
|
||||
val characters = content.select("a").map { it.text() }
|
||||
tags += characters.map {
|
||||
RaisedTag(
|
||||
"character",
|
||||
it,
|
||||
HitomiSearchMetadata.TAG_TYPE_DEFAULT,
|
||||
)
|
||||
}
|
||||
}
|
||||
"tags" -> {
|
||||
tags += content.select("a").map {
|
||||
val ns = when {
|
||||
it.attr("href").startsWith("/tag/male") -> "male"
|
||||
it.attr("href").startsWith("/tag/female") -> "female"
|
||||
else -> "misc"
|
||||
}
|
||||
RaisedTag(
|
||||
ns,
|
||||
it.text().dropLast(if (ns == "misc") 0 else 2),
|
||||
HitomiSearchMetadata.TAG_TYPE_DEFAULT,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uploadDate = try {
|
||||
DATE_FORMAT.parse(input.selectFirst(".gallery-info .date")!!.text())!!.time
|
||||
} catch (e: Exception) {
|
||||
null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override val matchingHosts = listOf(
|
||||
"hitomi.la",
|
||||
)
|
||||
|
||||
override suspend fun mapUrlToMangaUrl(uri: Uri): String? {
|
||||
val lcFirstPathSegment = uri.pathSegments.firstOrNull()?.lowercase() ?: return null
|
||||
|
||||
if (lcFirstPathSegment != "manga" && lcFirstPathSegment != "reader") {
|
||||
return null
|
||||
}
|
||||
|
||||
return "https://hitomi.la/manga/${uri.pathSegments[1].substringBefore('.')}.html"
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val otherId = 2703068117101782422L
|
||||
private val DATE_FORMAT by lazy {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
SimpleDateFormat("yyyy-MM-dd HH:mm:ssX", Locale.US)
|
||||
} else {
|
||||
SimpleDateFormat("yyyy-MM-dd HH:mm:ss'-05'", Locale.US)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,132 +0,0 @@
|
||||
package eu.kanade.tachiyomi.source.online.all
|
||||
|
||||
import android.content.Context
|
||||
import android.net.Uri
|
||||
import androidx.core.net.toUri
|
||||
import eu.kanade.tachiyomi.network.await
|
||||
import eu.kanade.tachiyomi.source.model.FilterList
|
||||
import eu.kanade.tachiyomi.source.model.SManga
|
||||
import eu.kanade.tachiyomi.source.online.HttpSource
|
||||
import eu.kanade.tachiyomi.source.online.MetadataSource
|
||||
import eu.kanade.tachiyomi.source.online.UrlImportableSource
|
||||
import eu.kanade.tachiyomi.util.asJsoup
|
||||
import exh.metadata.metadata.PervEdenSearchMetadata
|
||||
import exh.metadata.metadata.base.RaisedSearchMetadata
|
||||
import exh.metadata.metadata.base.RaisedTag
|
||||
import exh.source.DelegatedHttpSource
|
||||
import exh.util.urlImportFetchSearchManga
|
||||
import org.jsoup.nodes.Document
|
||||
import org.jsoup.nodes.Element
|
||||
import org.jsoup.nodes.TextNode
|
||||
|
||||
class PervEden(delegate: HttpSource, val context: Context) :
|
||||
DelegatedHttpSource(delegate),
|
||||
MetadataSource<PervEdenSearchMetadata, Document>,
|
||||
UrlImportableSource {
|
||||
override val metaClass = PervEdenSearchMetadata::class
|
||||
override val lang = delegate.lang
|
||||
|
||||
// Support direct URL importing
|
||||
override fun fetchSearchManga(page: Int, query: String, filters: FilterList) =
|
||||
urlImportFetchSearchManga(context, query) {
|
||||
super.fetchSearchManga(page, query, filters)
|
||||
}
|
||||
|
||||
override suspend fun getMangaDetails(manga: SManga): SManga {
|
||||
val response = client.newCall(mangaDetailsRequest(manga)).await()
|
||||
return parseToManga(manga, response.asJsoup())
|
||||
}
|
||||
|
||||
override suspend fun parseIntoMetadata(metadata: PervEdenSearchMetadata, input: Document) {
|
||||
with(metadata) {
|
||||
url = input.location().toUri().path
|
||||
|
||||
pvId = PervEdenSearchMetadata.pvIdFromUrl(url!!)
|
||||
|
||||
lang = this@PervEden.lang
|
||||
|
||||
title = input.getElementsByClass("manga-title").first()?.text()
|
||||
|
||||
thumbnailUrl = "http:" + input.getElementsByClass("mangaImage2").first()?.child(0)?.attr("src")
|
||||
|
||||
val rightBoxElement = input.select(".rightBox:not(.info)").first()
|
||||
|
||||
val newAltTitles = mutableListOf<String>()
|
||||
tags.clear()
|
||||
var inStatus: String? = null
|
||||
rightBoxElement!!.childNodes().forEach {
|
||||
if (it is Element && it.tagName().lowercase() == "h4") {
|
||||
inStatus = it.text().trim()
|
||||
} else {
|
||||
when (inStatus) {
|
||||
"Alternative name(s)" -> {
|
||||
if (it is TextNode) {
|
||||
val text = it.text().trim()
|
||||
if (text.isNotBlank()) {
|
||||
newAltTitles += text
|
||||
}
|
||||
}
|
||||
}
|
||||
"Artist" -> {
|
||||
if (it is Element && it.tagName() == "a") {
|
||||
artist = it.text()
|
||||
tags += RaisedTag(
|
||||
"artist",
|
||||
it.text().lowercase(),
|
||||
RaisedSearchMetadata.TAG_TYPE_VIRTUAL,
|
||||
)
|
||||
}
|
||||
}
|
||||
"Genres" -> {
|
||||
if (it is Element && it.tagName() == "a") {
|
||||
tags += RaisedTag(
|
||||
null,
|
||||
it.text().lowercase(),
|
||||
PervEdenSearchMetadata.TAG_TYPE_DEFAULT,
|
||||
)
|
||||
}
|
||||
}
|
||||
"Type" -> {
|
||||
if (it is TextNode) {
|
||||
val text = it.text().trim()
|
||||
if (text.isNotBlank()) {
|
||||
genre = text
|
||||
}
|
||||
}
|
||||
}
|
||||
"Status" -> {
|
||||
if (it is TextNode) {
|
||||
val text = it.text().trim()
|
||||
if (text.isNotBlank()) {
|
||||
status = text
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
altTitles = newAltTitles
|
||||
|
||||
rating = input.getElementById("rating-score")?.attr("value")?.toFloat()
|
||||
}
|
||||
}
|
||||
|
||||
override val matchingHosts = listOf("www.perveden.com")
|
||||
|
||||
override fun matchesUri(uri: Uri): Boolean {
|
||||
return super.matchesUri(uri) && uri.pathSegments.firstOrNull()?.lowercase() == when (lang) {
|
||||
"en" -> "en-manga"
|
||||
"it" -> "it-manga"
|
||||
else -> false
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun mapUrlToMangaUrl(uri: Uri): String {
|
||||
val newUri = "http://www.perveden.com/".toUri().buildUpon()
|
||||
uri.pathSegments.take(3).forEach {
|
||||
newUri.appendPath(it)
|
||||
}
|
||||
return newUri.toString()
|
||||
}
|
||||
}
|
||||
@@ -36,8 +36,6 @@ import eu.kanade.tachiyomi.util.system.toast
|
||||
import exh.favorites.FavoritesIntroDialog
|
||||
import exh.favorites.FavoritesSyncStatus
|
||||
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.isEhBasedManga
|
||||
import exh.source.mangaDexSourceIds
|
||||
import exh.source.nHentaiSourceIds
|
||||
@@ -336,9 +334,7 @@ class LibraryController(
|
||||
private fun cleanTitles() {
|
||||
val mangas = presenter.selection.filter {
|
||||
it.manga.isEhBasedManga() ||
|
||||
it.manga.source in nHentaiSourceIds ||
|
||||
it.manga.source == PERV_EDEN_EN_SOURCE_ID ||
|
||||
it.manga.source == PERV_EDEN_IT_SOURCE_ID
|
||||
it.manga.source in nHentaiSourceIds
|
||||
}
|
||||
presenter.cleanTitles(mangas)
|
||||
presenter.clearSelection()
|
||||
|
||||
Reference in New Issue
Block a user