* comick: fix filters not resetting

* allanime: fix filters not resetting & nullable picture urls (shit source)

* rmanga: fix filters not resetting
This commit is contained in:
AwkwardPeak7 2023-06-12 23:59:51 +05:00 committed by GitHub
parent 3ed3262db1
commit f2ffc4075c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 14 additions and 16 deletions

View File

@ -6,7 +6,7 @@ ext {
extName = 'Comick'
pkgNameSuffix = 'all.comickfun'
extClass = '.ComickFunFactory'
extVersionCode = 27
extVersionCode = 28
isNsfw = true
}

View File

@ -293,9 +293,7 @@ abstract class ComickFun(
protected open val defaultPopularSort: Int = 0
protected open val defaultLatestSort: Int = 4
override fun getFilterList() = FilterList(
getFilters(),
)
override fun getFilterList() = getFilters()
override fun setupPreferenceScreen(screen: PreferenceScreen) {
ListPreference(screen.context).apply {

View File

@ -3,7 +3,7 @@ package eu.kanade.tachiyomi.extension.all.comickfun
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
internal fun getFilters(): FilterList {
fun getFilters(): FilterList {
return FilterList(
Filter.Header(name = "NOTE: Everything below is ignored if using text search"),
CompletedFilter("Completed translation"),

View File

@ -6,7 +6,7 @@ ext {
extName = 'AllAnime'
pkgNameSuffix = 'en.allanime'
extClass = '.AllAnime'
extVersionCode = 3
extVersionCode = 4
}
apply from: "$rootDir/common.gradle"

View File

@ -145,7 +145,7 @@ class AllAnime : ConfigurableSource, HttpSource() {
return MangasPage(mangaList, mangaList.size == limit)
}
override fun getFilterList() = filters
override fun getFilterList() = getFilters()
/* Details */
override fun mangaDetailsRequest(manga: SManga): Request {
@ -271,17 +271,17 @@ class AllAnime : ConfigurableSource, HttpSource() {
?.groupValues
?.getOrNull(1)
?.replace("\\u002F", "/")
?.substringBeforeLast(pages.pictureUrls.first().toString(), "")
?.substringBeforeLast(pages.pictureUrls?.first().toString(), "")
}
url?.takeIf { it.isNotEmpty() } ?: return emptyList()
}
return pages.pictureUrls.mapIndexed { index, image ->
return pages.pictureUrls?.mapIndexed { index, image ->
Page(
index = index,
imageUrl = "$imageDomain${image.url}#page",
)
}
} ?: emptyList()
}
override fun pageListParse(response: Response): List<Page> {

View File

@ -157,7 +157,7 @@ data class ApiPageListResponse(
@Serializable
data class Servers(
@SerialName("pictureUrlHead") val serverUrl: String? = null,
val pictureUrls: List<PageUrl>,
val pictureUrls: List<PageUrl>?,
) {
@Serializable
data class PageUrl(

View File

@ -97,7 +97,7 @@ private val countryList: List<Pair<String, String>> = listOf(
Pair("Korea", "KR"),
)
val filters = FilterList(
fun getFilters() = FilterList(
CountryFilter("Countries", countryList),
GenreFilter("Genres", genreList),
)

View File

@ -5,7 +5,7 @@ ext {
extName = 'Rmanga.app'
pkgNameSuffix = 'en.rmanga'
extClass = '.Rmanga'
extVersionCode = 1
extVersionCode = 2
}
apply from: "$rootDir/common.gradle"

View File

@ -119,7 +119,7 @@ class Rmanga : ConfigurableSource, ParsedHttpSource() {
return POST("$baseUrl/detailed-search", headers, payload)
}
override fun getFilterList() = filters
override fun getFilterList() = getFilters()
override fun searchMangaFromElement(element: Element) = popularMangaFromElement(element)

View File

@ -8,7 +8,7 @@ class Genre(
val id: String,
) : Filter.TriState(name)
internal class GenreFilter(name: String, private val genres: List<Genre>) :
internal class GenreFilter(name: String, genres: List<Genre>) :
Filter.Group<Genre>(name, genres)
private val genreList = listOf(
@ -86,7 +86,7 @@ private val statusFilter: Array<String> = arrayOf(
"Completed",
)
val filters = FilterList(
fun getFilters() = FilterList(
TypeFilter("Type", typeFilter),
AuthorFilter("Author"),
ArtistFilter("Artist"),