mirror of
https://github.com/gotson/komga.git
synced 2025-12-20 15:34:17 +01:00
feat: configuration property to disable file hashing
set komga.file-hashing=false to disable it
This commit is contained in:
parent
7b8cf7ae25
commit
52db0a1686
3 changed files with 9 additions and 3 deletions
|
|
@ -9,6 +9,7 @@ import org.gotson.komga.domain.model.Media
|
|||
import org.gotson.komga.domain.persistence.BookRepository
|
||||
import org.gotson.komga.domain.persistence.LibraryRepository
|
||||
import org.gotson.komga.domain.service.BookConverter
|
||||
import org.gotson.komga.infrastructure.configuration.KomgaProperties
|
||||
import org.gotson.komga.infrastructure.jms.QUEUE_SUB_TYPE
|
||||
import org.gotson.komga.infrastructure.jms.QUEUE_TASKS
|
||||
import org.gotson.komga.infrastructure.jms.QUEUE_TASKS_TYPE
|
||||
|
|
@ -27,6 +28,7 @@ class TaskReceiver(
|
|||
private val libraryRepository: LibraryRepository,
|
||||
private val bookRepository: BookRepository,
|
||||
private val bookConverter: BookConverter,
|
||||
private val komgaProperties: KomgaProperties,
|
||||
) {
|
||||
|
||||
private val jmsTemplates = (0..9).associateWith {
|
||||
|
|
@ -61,9 +63,10 @@ class TaskReceiver(
|
|||
}
|
||||
|
||||
fun hashBooksWithoutHash(library: Library) {
|
||||
bookRepository.findAllIdsByLibraryIdAndWithEmptyHash(library.id).forEach {
|
||||
submitTask(Task.HashBook(it, LOWEST_PRIORITY))
|
||||
}
|
||||
if (komgaProperties.fileHashing)
|
||||
bookRepository.findAllIdsByLibraryIdAndWithEmptyHash(library.id).forEach {
|
||||
submitTask(Task.HashBook(it, LOWEST_PRIORITY))
|
||||
}
|
||||
}
|
||||
|
||||
fun convertBooksToCbz(library: Library, priority: Int = DEFAULT_PRIORITY) {
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ class KomgaProperties {
|
|||
|
||||
var deleteEmptyCollections: Boolean = true
|
||||
|
||||
var fileHashing: Boolean = true
|
||||
|
||||
var rememberMe = RememberMe()
|
||||
|
||||
var nativeWebp: Boolean = true
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ komga:
|
|||
file: ":memory:"
|
||||
cors.allowed-origins:
|
||||
- http://localhost:8081
|
||||
# file-hashing: false
|
||||
# delete-empty-collections: true
|
||||
# delete-empty-read-lists: true
|
||||
spring:
|
||||
|
|
|
|||
Loading…
Reference in a new issue