mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-06-30 17:34:39 -05:00
empty searchTerm support (#259)
* linter run * convert search params to queryParams
This commit is contained in:
@@ -47,8 +47,8 @@ object MangaAPI {
|
|||||||
get("{sourceId}/filters", SourceController::getFilters)
|
get("{sourceId}/filters", SourceController::getFilters)
|
||||||
post("{sourceId}/filters", SourceController::setFilter)
|
post("{sourceId}/filters", SourceController::setFilter)
|
||||||
|
|
||||||
get("{sourceId}/search/{searchTerm}/{pageNum}", SourceController::searchSingle)
|
get("{sourceId}/search", SourceController::searchSingle)
|
||||||
// get("search/{searchTerm}/{pageNum}", SourceController::searchGlobal)
|
// get("all/search", SourceController::searchGlobal) // TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
path("manga") {
|
path("manga") {
|
||||||
|
|||||||
@@ -80,8 +80,8 @@ object SourceController {
|
|||||||
/** single source search */
|
/** single source search */
|
||||||
fun searchSingle(ctx: Context) {
|
fun searchSingle(ctx: Context) {
|
||||||
val sourceId = ctx.pathParam("sourceId").toLong()
|
val sourceId = ctx.pathParam("sourceId").toLong()
|
||||||
val searchTerm = ctx.pathParam("searchTerm")
|
val searchTerm = ctx.queryParam("searchTerm") ?: ""
|
||||||
val pageNum = ctx.pathParam("pageNum").toInt()
|
val pageNum = ctx.queryParam("pageNum")?.toInt() ?: 1
|
||||||
ctx.future(future { Search.sourceSearch(sourceId, searchTerm, pageNum) })
|
ctx.future(future { Search.sourceSearch(sourceId, searchTerm, pageNum) })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,6 @@ import java.io.File
|
|||||||
*
|
*
|
||||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
fun File.renameTo(newPath: String) = renameTo(File(newPath))
|
fun File.renameTo(newPath: String) = renameTo(File(newPath))
|
||||||
|
|||||||
Reference in New Issue
Block a user