Update GalleryAdults (#3416)
This commit is contained in:
parent
ce5160d32a
commit
7f87376a73
|
@ -2,4 +2,4 @@ plugins {
|
||||||
id("lib-multisrc")
|
id("lib-multisrc")
|
||||||
}
|
}
|
||||||
|
|
||||||
baseVersionCode = 1
|
baseVersionCode = 2
|
||||||
|
|
|
@ -294,7 +294,7 @@ abstract class GalleryAdults(
|
||||||
val categoryFilters = filters.filterIsInstance<CategoryFilters>().firstOrNull()
|
val categoryFilters = filters.filterIsInstance<CategoryFilters>().firstOrNull()
|
||||||
|
|
||||||
// Only for query string or multiple tags
|
// Only for query string or multiple tags
|
||||||
val url = "$baseUrl/search".toHttpUrl().newBuilder().apply {
|
val url = "$baseUrl/search/".toHttpUrl().newBuilder().apply {
|
||||||
getSortOrderURIs().forEachIndexed { index, pair ->
|
getSortOrderURIs().forEachIndexed { index, pair ->
|
||||||
addQueryParameter(pair.second, toBinary(sortOrderFilter?.state == index))
|
addQueryParameter(pair.second, toBinary(sortOrderFilter?.state == index))
|
||||||
}
|
}
|
||||||
|
@ -310,7 +310,7 @@ abstract class GalleryAdults(
|
||||||
addEncodedQueryParameter(intermediateSearchKey, buildQueryString(selectedGenres.map { it.name }, query))
|
addEncodedQueryParameter(intermediateSearchKey, buildQueryString(selectedGenres.map { it.name }, query))
|
||||||
addPageUri(page)
|
addPageUri(page)
|
||||||
}
|
}
|
||||||
return GET(url.build())
|
return GET(url.build(), headers)
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open val advancedSearchKey = "key"
|
protected open val advancedSearchKey = "key"
|
||||||
|
@ -331,7 +331,7 @@ abstract class GalleryAdults(
|
||||||
// Advanced search
|
// Advanced search
|
||||||
val advancedSearchFilters = filters.filterIsInstance<AdvancedTextFilter>()
|
val advancedSearchFilters = filters.filterIsInstance<AdvancedTextFilter>()
|
||||||
|
|
||||||
val url = "$baseUrl/$advancedSearchUri".toHttpUrl().newBuilder().apply {
|
val url = "$baseUrl/$advancedSearchUri/".toHttpUrl().newBuilder().apply {
|
||||||
getSortOrderURIs().forEachIndexed { index, pair ->
|
getSortOrderURIs().forEachIndexed { index, pair ->
|
||||||
addQueryParameter(pair.second, toBinary(sortOrderFilter?.state == index))
|
addQueryParameter(pair.second, toBinary(sortOrderFilter?.state == index))
|
||||||
}
|
}
|
||||||
|
@ -379,7 +379,7 @@ abstract class GalleryAdults(
|
||||||
addEncodedQueryParameter(advancedSearchKey, keys.joinToString("+"))
|
addEncodedQueryParameter(advancedSearchKey, keys.joinToString("+"))
|
||||||
addPageUri(page)
|
addPageUri(page)
|
||||||
}
|
}
|
||||||
return GET(url.build())
|
return GET(url.build(), headers)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -18,6 +18,15 @@ class AsmHentai(
|
||||||
lang = lang,
|
lang = lang,
|
||||||
) {
|
) {
|
||||||
override val supportsLatest = mangaLang.isNotBlank()
|
override val supportsLatest = mangaLang.isNotBlank()
|
||||||
|
override val supportSpeechless: Boolean = true
|
||||||
|
|
||||||
|
override fun Element.mangaLang() =
|
||||||
|
select("a:has(.flag)").attr("href")
|
||||||
|
.removeSuffix("/").substringAfterLast("/")
|
||||||
|
.let {
|
||||||
|
// Include Speechless in search results
|
||||||
|
if (it == LANGUAGE_SPEECHLESS) mangaLang else it
|
||||||
|
}
|
||||||
|
|
||||||
override fun Element.mangaUrl() =
|
override fun Element.mangaUrl() =
|
||||||
selectFirst(".image a")?.attr("abs:href")
|
selectFirst(".image a")?.attr("abs:href")
|
||||||
|
@ -25,10 +34,6 @@ class AsmHentai(
|
||||||
override fun Element.mangaThumbnail() =
|
override fun Element.mangaThumbnail() =
|
||||||
selectFirst(".image img")?.imgAttr()
|
selectFirst(".image img")?.imgAttr()
|
||||||
|
|
||||||
override fun Element.mangaLang() =
|
|
||||||
select("a:has(.flag)").attr("href")
|
|
||||||
.removeSuffix("/").substringAfterLast("/")
|
|
||||||
|
|
||||||
override fun popularMangaSelector() = ".preview_item"
|
override fun popularMangaSelector() = ".preview_item"
|
||||||
|
|
||||||
override val favoritePath = "inc/user.php?act=favs"
|
override val favoritePath = "inc/user.php?act=favs"
|
||||||
|
|
Loading…
Reference in New Issue