From cbb0bdf85c14594514e6ead2f4bf39b1206bf0e1 Mon Sep 17 00:00:00 2001 From: Vincent TE Date: Mon, 9 Dec 2024 14:33:11 +0100 Subject: [PATCH] fix: Execute file tree generation when we generate the transfer locally --- .../database/controllers/TransferController.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/STDatabase/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/database/controllers/TransferController.kt b/STDatabase/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/database/controllers/TransferController.kt index 7328c8ee..acd3c2d3 100644 --- a/STDatabase/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/database/controllers/TransferController.kt +++ b/STDatabase/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/database/controllers/TransferController.kt @@ -95,8 +95,14 @@ class TransferController(private val realmProvider: RealmProvider) { uploadSession: UploadSession, transferStatus: TransferStatus, ) = runThrowingRealm { + val transferDB = TransferDB(linkUUID, uploadSession, transferStatus).apply { + container?.files?.let { files -> + FileUtils.getFileDBTree(containerUUID, files) + } + } + realm.write { - this.copyToRealm(TransferDB(linkUUID, uploadSession, transferStatus), UpdatePolicy.ALL) + this.copyToRealm(transferDB, UpdatePolicy.ALL) } } //endregion