diff --git a/server/src/main/kotlin/suwayomi/tachidesk/manga/MangaAPI.kt b/server/src/main/kotlin/suwayomi/tachidesk/manga/MangaAPI.kt index 0f2dc9f5..ed5e94af 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/manga/MangaAPI.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/manga/MangaAPI.kt @@ -47,8 +47,8 @@ object MangaAPI { get("{sourceId}/filters", SourceController::getFilters) post("{sourceId}/filters", SourceController::setFilter) - get("{sourceId}/search/{searchTerm}/{pageNum}", SourceController::searchSingle) -// get("search/{searchTerm}/{pageNum}", SourceController::searchGlobal) + get("{sourceId}/search", SourceController::searchSingle) +// get("all/search", SourceController::searchGlobal) // TODO } path("manga") { diff --git a/server/src/main/kotlin/suwayomi/tachidesk/manga/controller/SourceController.kt b/server/src/main/kotlin/suwayomi/tachidesk/manga/controller/SourceController.kt index 671931c5..9e1f0e96 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/manga/controller/SourceController.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/manga/controller/SourceController.kt @@ -80,8 +80,8 @@ object SourceController { /** single source search */ fun searchSingle(ctx: Context) { val sourceId = ctx.pathParam("sourceId").toLong() - val searchTerm = ctx.pathParam("searchTerm") - val pageNum = ctx.pathParam("pageNum").toInt() + val searchTerm = ctx.queryParam("searchTerm") ?: "" + val pageNum = ctx.queryParam("pageNum")?.toInt() ?: 1 ctx.future(future { Search.sourceSearch(sourceId, searchTerm, pageNum) }) } diff --git a/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/util/lang/io.kt b/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/util/lang/io.kt index 47dc0624..1e492643 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/util/lang/io.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/util/lang/io.kt @@ -7,6 +7,6 @@ import java.io.File * * 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 - * 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)) \ No newline at end of file +fun File.renameTo(newPath: String) = renameTo(File(newPath))