fix(storage): reclaim transfer cache and track received files

This commit is contained in:
2026-07-22 16:03:37 +02:00
parent 627c205853
commit b46c5e7d72
46 changed files with 1229 additions and 124 deletions

View File

@@ -2,7 +2,7 @@ package com.vnidrop.app.core
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import uniffi.vnidrop.ReceiveOutputSink
import uniffi.vnidrop.ReceiveOutputSinkV2
import java.io.File
@Composable
@@ -26,7 +26,25 @@ private class JvmFileSystemService : FileSystemService {
}.getOrDefault(FolderAccessStatus.Unavailable)
}
override fun createReceiveOutputSink(folder: ReceiveFolder): ReceiveOutputSink? = null
override suspend fun inspectReceivedArtifacts(artifacts: List<ReceivedArtifactModel>): ReceivedStorageInspection {
var bytes = 0UL
var existing = 0
var missing = 0
for (artifact in artifacts) {
val file = File(artifact.locator)
if (file.isFile) {
bytes += file.length().toULong()
existing += 1
} else {
missing += 1
}
}
return ReceivedStorageInspection(bytes, existing, missing, 0)
}
override suspend fun temporaryUsage(): ULong = 0UL
override fun createReceiveOutputSink(folder: ReceiveFolder): ReceiveOutputSinkV2? = null
override suspend fun sharePickedFiles(
repository: CoreGateway,