[CBHentai] Fix duplicated tags (#1873)
This commit is contained in:
@@ -534,6 +534,14 @@ internal abstract class MadaraParser(
|
||||
protected open val selectAlt =
|
||||
".post-content_item:contains(Alt) .summary-content, .post-content_item:contains(Nomes alternativos: ) .summary-content"
|
||||
|
||||
protected open fun createMangaTag(a: Element): MangaTag? {
|
||||
return MangaTag(
|
||||
key = a.attr("href").removeSuffix("/").substringAfterLast('/'),
|
||||
title = a.text().toTitleCase(),
|
||||
source = source,
|
||||
)
|
||||
}
|
||||
|
||||
override suspend fun getDetails(manga: Manga): Manga = coroutineScope {
|
||||
val fullUrl = manga.url.toAbsoluteUrl(domain)
|
||||
val doc = webClient.httpGet(fullUrl).parseHtml()
|
||||
@@ -566,13 +574,7 @@ internal abstract class MadaraParser(
|
||||
title = doc.selectFirst("h1")?.textOrNull() ?: manga.title,
|
||||
url = href,
|
||||
publicUrl = href.toAbsoluteUrl(domain),
|
||||
tags = doc.body().select(selectGenre).mapToSet { a ->
|
||||
MangaTag(
|
||||
key = a.attr("href").removeSuffix("/").substringAfterLast('/'),
|
||||
title = a.text().toTitleCase(),
|
||||
source = source,
|
||||
)
|
||||
},
|
||||
tags = doc.body().select(selectGenre).mapToSet { a -> createMangaTag(a) }.filterNotNull().toSet(),
|
||||
description = desc,
|
||||
altTitles = setOfNotNull(alt),
|
||||
state = state,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.koitharu.kotatsu.parsers.site.madara.vi
|
||||
|
||||
import org.jsoup.nodes.Element
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.exception.ParseException
|
||||
@@ -23,11 +24,19 @@ internal class HentaiCube(context: MangaLoaderContext) :
|
||||
override val datePattern = "dd/MM/yyyy"
|
||||
override val postReq = true
|
||||
override val postDataReq = "action=manga_views&manga="
|
||||
|
||||
|
||||
override suspend fun getFilterOptions() = MangaListFilterOptions(
|
||||
availableTags = fetchTags(),
|
||||
)
|
||||
|
||||
override fun createMangaTag(a: Element): MangaTag? {
|
||||
return MangaTag(
|
||||
title = a.text().replace(Regex("\\(\\d+\\)"), ""),
|
||||
key = a.attr("href").substringAfter("/theloai/").removeSuffix("/"),
|
||||
source = source,
|
||||
)
|
||||
}
|
||||
|
||||
override suspend fun getPages(chapter: MangaChapter): List<MangaPage> {
|
||||
val fullUrl = chapter.url.toAbsoluteUrl(domain)
|
||||
val doc = webClient.httpGet(fullUrl).parseHtml()
|
||||
|
||||
@@ -39,7 +39,7 @@ internal class MimiHentai(context: MangaLoaderContext) :
|
||||
SortOrder.ALPHABETICAL,
|
||||
SortOrder.POPULARITY,
|
||||
SortOrder.POPULARITY_TODAY,
|
||||
SortOrder.POPULARITY_WEEK,
|
||||
SortOrder.POPULARITY_WEEK,
|
||||
SortOrder.POPULARITY_MONTH,
|
||||
SortOrder.RATING,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user