Add a Status search filter and remove 1 deleted sort in Comick (#17269)

* Add a Status filter and remove 1 deleted sort

* Add Status filter

* Update build.gradle
This commit is contained in:
iD-666 2023-07-27 19:34:10 +07:00 committed by GitHub
parent 2df5bdfa68
commit ab0d6aceab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 5 deletions

View File

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

View File

@ -166,6 +166,9 @@ abstract class ComickFun(
is SortFilter -> {
addQueryParameter("sort", it.getValue())
}
is StatusFilter -> {
addQueryParameter("status", it.getValue())
}
is CreatedAtFilter -> {
if (it.state > 0) {
addQueryParameter("time", it.getValue())

View File

@ -5,13 +5,14 @@ import eu.kanade.tachiyomi.source.model.FilterList
fun getFilters(): FilterList {
return FilterList(
Filter.Header(name = "NOTE: Everything below is ignored if using text search"),
CompletedFilter("Completed translation"),
Filter.Header(name = "The filter is ignored when using text search."),
GenreFilter("Genre", getGenresList),
DemographicFilter("Demographic", getDemographicList),
TypeFilter("Type", getTypeList),
SortFilter("Sort", getSortsList),
CreatedAtFilter("Created At", getCreatedAtList),
StatusFilter("Status", getStatusList),
CompletedFilter("Completely Scanlated?"),
CreatedAtFilter("Created at", getCreatedAtList),
MinimumFilter("Minimum Chapters"),
Filter.Header("From Year, ex: 2010"),
FromYearFilter("From"),
@ -48,6 +49,9 @@ internal class ToYearFilter(name: String) : Text(name)
internal class SortFilter(name: String, sortList: Array<Pair<String, String>>, state: Int = 0) :
Select(name, sortList, state)
internal class StatusFilter(name: String, statusList: Array<Pair<String, String>>, state: Int = 0) :
Select(name, statusList, state)
/** Generics **/
internal open class Group(name: String, values: List<Any>) :
Filter.Group<Any>(name, values)
@ -174,10 +178,17 @@ private val getCreatedAtList: Array<Pair<String, String>> = arrayOf(
)
private val getSortsList: Array<Pair<String, String>> = arrayOf(
Pair("Most popular", "follow"),
Pair("Most follows", "user_follow_count"),
Pair("Most views", "view"),
Pair("High rating", "rating"),
Pair("Last updated", "uploaded"),
Pair("Newest", "created_at"),
)
private val getStatusList: Array<Pair<String, String>> = arrayOf(
Pair("All", ""),
Pair("Ongoing", "1"),
Pair("Completed", "2"),
Pair("Cancelled", "3"),
Pair("Hiatus", "4"),
)