filter deleted series and books (#8132)

This commit is contained in:
Gauthier 2021-07-16 18:23:22 +08:00 committed by GitHub
parent 7fdc36a679
commit 3ff3a4f82f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 5 deletions

View File

@ -1,3 +1,11 @@
## 1.2.29
Minimum Komga version required: `0.97.0`
### Features
* filter deleted series and books
## 1.2.28
Minimum Komga version required: `0.97.0`

View File

@ -5,7 +5,7 @@ ext {
extName = 'Komga'
pkgNameSuffix = 'all.komga'
extClass = '.KomgaFactory'
extVersionCode = 28
extVersionCode = 29
libVersion = '1.2'
}

View File

@ -43,13 +43,13 @@ import java.util.Locale
open class Komga(suffix: String = "") : ConfigurableSource, HttpSource() {
override fun popularMangaRequest(page: Int): Request =
GET("$baseUrl/api/v1/series?page=${page - 1}", headers)
GET("$baseUrl/api/v1/series?page=${page - 1}&deleted=false", headers)
override fun popularMangaParse(response: Response): MangasPage =
processSeriesPage(response)
override fun latestUpdatesRequest(page: Int): Request =
GET("$baseUrl/api/v1/series/latest?page=${page - 1}", headers)
GET("$baseUrl/api/v1/series/latest?page=${page - 1}&deleted=false", headers)
override fun latestUpdatesParse(response: Response): MangasPage =
processSeriesPage(response)
@ -65,7 +65,7 @@ open class Komga(suffix: String = "") : ConfigurableSource, HttpSource() {
else -> "series"
}
val url = "$baseUrl/api/v1/$type?search=$query&page=${page - 1}".toHttpUrlOrNull()!!.newBuilder()
val url = "$baseUrl/api/v1/$type?search=$query&page=${page - 1}&deleted=false".toHttpUrlOrNull()!!.newBuilder()
filters.forEach { filter ->
when (filter) {
@ -185,7 +185,7 @@ open class Komga(suffix: String = "") : ConfigurableSource, HttpSource() {
}
override fun chapterListRequest(manga: SManga): Request =
GET("${manga.url}/books?unpaged=true&media_status=READY", headers)
GET("${manga.url}/books?unpaged=true&media_status=READY&deleted=false", headers)
override fun chapterListParse(response: Response): List<SChapter> {
val page = gson.fromJson<PageWrapperDto<BookDto>>(response.body?.charStream()!!).content