From 2bbebe4c30f165e43dc81d8b53694bb502fd914e Mon Sep 17 00:00:00 2001 From: Aria Moradi Date: Sat, 20 Feb 2021 02:34:26 +0330 Subject: [PATCH] fix removing manga from library not working --- server/src/main/kotlin/ir/armor/tachidesk/Main.kt | 1 - server/src/main/kotlin/ir/armor/tachidesk/util/Library.kt | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/server/src/main/kotlin/ir/armor/tachidesk/Main.kt b/server/src/main/kotlin/ir/armor/tachidesk/Main.kt index a032ca7..4037123 100644 --- a/server/src/main/kotlin/ir/armor/tachidesk/Main.kt +++ b/server/src/main/kotlin/ir/armor/tachidesk/Main.kt @@ -166,7 +166,6 @@ class Main { // removes the manga from the library app.delete("api/v1/manga/:mangaId/library") { ctx -> val mangaId = ctx.pathParam("mangaId").toInt() - println("fuck") removeMangaFromLibrary(mangaId) ctx.status(200) } diff --git a/server/src/main/kotlin/ir/armor/tachidesk/util/Library.kt b/server/src/main/kotlin/ir/armor/tachidesk/util/Library.kt index 97abcec..dd390e8 100644 --- a/server/src/main/kotlin/ir/armor/tachidesk/util/Library.kt +++ b/server/src/main/kotlin/ir/armor/tachidesk/util/Library.kt @@ -25,7 +25,7 @@ fun addMangaToLibrary(mangaId: Int) { fun removeMangaFromLibrary(mangaId: Int) { val manga = getManga(mangaId) - if (!manga.inLibrary) { + if (manga.inLibrary) { transaction { MangaTable.update({ MangaTable.id eq manga.id }) { it[inLibrary] = false