Changed order

This commit is contained in:
bskjon 2025-02-20 21:32:28 +01:00
parent 9424f25dcc
commit a4c1b6978d

View File

@ -23,13 +23,9 @@ class UnattendedIndexing {
@Scheduled(fixedDelay = 60_000*60) @Scheduled(fixedDelay = 60_000*60)
fun indexContent() { fun indexContent() {
logger.info { "Performing indexing of input root: ${SharedConfig.inputRoot.absolutePath}" } logger.info { "Performing indexing of input root: ${SharedConfig.inputRoot.absolutePath}" }
val foundFiles: MutableList<File> = mutableListOf() val fileList = SharedConfig.inputRoot.walkTopDown().filter { it.isFile && it.isSupportedVideoFile() }
SharedConfig.inputRoot.walkTopDown().filter { it.isFile && it.isSupportedVideoFile() }.also { fileList.forEach { file ->
foundFiles.addAll(it) withTransaction(eventDatabase.database) {
}
withTransaction(eventDatabase.database) {
foundFiles.forEach { file ->
files.insertIgnore { files.insertIgnore {
it[this.fileName] = file.absolutePath it[this.fileName] = file.absolutePath
it[this.baseName] = file.nameWithoutExtension it[this.baseName] = file.nameWithoutExtension