filter series by in progress and read (#7446)
This commit is contained in:
parent
de7dbfa7e9
commit
380b7594f5
|
@ -1,3 +1,11 @@
|
|||
## 1.2.27
|
||||
|
||||
Minimum Komga version required: `0.97.0`
|
||||
|
||||
### Fix
|
||||
|
||||
* filter series by read or in progress
|
||||
|
||||
## 1.2.26
|
||||
|
||||
Minimum Komga version required: `0.87.4`
|
||||
|
|
|
@ -5,7 +5,7 @@ ext {
|
|||
extName = 'Komga'
|
||||
pkgNameSuffix = 'all.komga'
|
||||
extClass = '.KomgaFactory'
|
||||
extVersionCode = 26
|
||||
extVersionCode = 27
|
||||
libVersion = '1.2'
|
||||
}
|
||||
|
||||
|
|
|
@ -69,12 +69,22 @@ open class Komga(suffix: String = "") : ConfigurableSource, HttpSource() {
|
|||
|
||||
filters.forEach { filter ->
|
||||
when (filter) {
|
||||
is UnreadOnly -> {
|
||||
is UnreadFilter -> {
|
||||
if (filter.state) {
|
||||
url.addQueryParameter("read_status", "UNREAD")
|
||||
url.addQueryParameter("read_status", "IN_PROGRESS")
|
||||
}
|
||||
}
|
||||
is InProgressFilter -> {
|
||||
if (filter.state) {
|
||||
url.addQueryParameter("read_status", "IN_PROGRESS")
|
||||
}
|
||||
}
|
||||
is ReadFilter -> {
|
||||
if (filter.state) {
|
||||
url.addQueryParameter("read_status", "READ")
|
||||
}
|
||||
}
|
||||
is LibraryGroup -> {
|
||||
val libraryToInclude = mutableListOf<String>()
|
||||
filter.state.forEach { content ->
|
||||
|
@ -286,7 +296,9 @@ open class Komga(suffix: String = "") : ConfigurableSource, HttpSource() {
|
|||
private class SeriesSort : Filter.Sort("Sort", arrayOf("Alphabetically", "Date added", "Date updated"), Selection(0, true))
|
||||
private class StatusFilter(name: String) : Filter.CheckBox(name, false)
|
||||
private class StatusGroup(filters: List<StatusFilter>) : Filter.Group<StatusFilter>("Status", filters)
|
||||
private class UnreadOnly : Filter.CheckBox("Unread only", false)
|
||||
private class UnreadFilter : Filter.CheckBox("Unread", false)
|
||||
private class InProgressFilter : Filter.CheckBox("In Progress", false)
|
||||
private class ReadFilter : Filter.CheckBox("Read", false)
|
||||
private class GenreFilter(genre: String) : Filter.CheckBox(genre, false)
|
||||
private class GenreGroup(genres: List<GenreFilter>) : Filter.Group<GenreFilter>("Genres", genres)
|
||||
private class TagFilter(tag: String) : Filter.CheckBox(tag, false)
|
||||
|
@ -306,17 +318,19 @@ open class Komga(suffix: String = "") : ConfigurableSource, HttpSource() {
|
|||
override fun getFilterList(): FilterList {
|
||||
val filters = try {
|
||||
mutableListOf<Filter<*>>(
|
||||
UnreadOnly(),
|
||||
UnreadFilter(),
|
||||
InProgressFilter(),
|
||||
ReadFilter(),
|
||||
TypeSelect(),
|
||||
CollectionSelect(listOf(CollectionFilterEntry("None")) + collections.map { CollectionFilterEntry(it.name, it.id) }),
|
||||
LibraryGroup(libraries.map { LibraryFilter(it.id, it.name) }.sortedBy { it.name.toLowerCase() }),
|
||||
LibraryGroup(libraries.map { LibraryFilter(it.id, it.name) }.sortedBy { it.name.toLowerCase(Locale.ROOT) }),
|
||||
StatusGroup(listOf("Ongoing", "Ended", "Abandoned", "Hiatus").map { StatusFilter(it) }),
|
||||
GenreGroup(genres.map { GenreFilter(it) }),
|
||||
TagGroup(tags.map { TagFilter(it) }),
|
||||
PublisherGroup(publishers.map { PublisherFilter(it) })
|
||||
).also {
|
||||
it.addAll(authors.map { (role, authors) -> AuthorGroup(role, authors.map { AuthorFilter(it) }) })
|
||||
it.add(SeriesSort())
|
||||
).also { list ->
|
||||
list.addAll(authors.map { (role, authors) -> AuthorGroup(role, authors.map { AuthorFilter(it) }) })
|
||||
list.add(SeriesSort())
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Log.e(LOG_TAG, "error while creating filter list", e)
|
||||
|
|
Loading…
Reference in New Issue