Skip to content

Commit e05f206

Browse files
committed
Force thumbnail generation to compare listing performance
1 parent 7110a54 commit e05f206

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

data/src/main/java/org/cryptomator/data/cloud/crypto/CryptoImplDecorator.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,12 +480,18 @@ abstract class CryptoImplDecorator(
480480
val firstCryptoFile = list.find { it is CryptoFile } ?: return list
481481
val cloudType = (firstCryptoFile as CryptoFile).cloudFile.cloud?.type() ?: return list
482482
val diskCache = getLruCacheFor(cloudType) ?: return list
483-
list.onEach { cryptoNode ->
483+
list.forEach { cryptoNode ->
484484
if (cryptoNode is CryptoFile && isImageMediaType(cryptoNode.name)) {
485485
val cacheKey = generateCacheKey(cryptoNode.cloudFile)
486486
val cacheFile = diskCache[cacheKey]
487487
if (cacheFile != null) {
488488
cryptoNode.thumbnail = cacheFile
489+
} else {
490+
// TODO
491+
// force thumbnail generation (~PER FOLDER)
492+
val trash = File.createTempFile(cryptoNode.name, ".temp", internalCache)
493+
read(cryptoNode, trash.outputStream(), ProgressAware.NO_OP_PROGRESS_AWARE_DOWNLOAD)
494+
trash.delete()
489495
}
490496
}
491497
}

0 commit comments

Comments
 (0)