From 9b650ccc463f17851f2e7621e39806d137b9444a Mon Sep 17 00:00:00 2001 From: Gauthier Roebroeck Date: Wed, 9 Aug 2023 10:46:40 +0800 Subject: [PATCH] fix: better handling of oneshot file deletion Closes: #1192 --- .../kotlin/org/gotson/komga/application/tasks/TaskHandler.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/komga/src/main/kotlin/org/gotson/komga/application/tasks/TaskHandler.kt b/komga/src/main/kotlin/org/gotson/komga/application/tasks/TaskHandler.kt index 189517df..f8ffe232 100644 --- a/komga/src/main/kotlin/org/gotson/komga/application/tasks/TaskHandler.kt +++ b/komga/src/main/kotlin/org/gotson/komga/application/tasks/TaskHandler.kt @@ -170,7 +170,8 @@ class TaskHandler( is Task.DeleteBook -> { bookRepository.findByIdOrNull(task.bookId)?.let { book -> - bookLifecycle.deleteBookFiles(book) + if (book.oneshot) seriesLifecycle.deleteSeriesFiles(seriesRepository.findByIdOrNull(book.seriesId)!!) + else bookLifecycle.deleteBookFiles(book) } }