mirror of
https://github.com/gotson/komga.git
synced 2025-12-27 02:46:04 +01:00
refactor: simplify code
This commit is contained in:
parent
8418ce8da0
commit
01ab0f7756
1 changed files with 2 additions and 6 deletions
|
|
@ -56,14 +56,10 @@ class BookLifecycle(
|
|||
|
||||
fun generateThumbnailAndPersist(book: Book) {
|
||||
logger.info { "Generate thumbnail and persist for book: $book" }
|
||||
val thumbnailBook = try {
|
||||
bookAnalyzer.generateThumbnail(book)
|
||||
try {
|
||||
addThumbnailForBook(bookAnalyzer.generateThumbnail(book))
|
||||
} catch (ex: Exception) {
|
||||
logger.error(ex) { "Error while creating thumbnail" }
|
||||
null
|
||||
}
|
||||
thumbnailBook?.let {
|
||||
addThumbnailForBook(it)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue