Skip to content

Commit

Permalink
Force thumbnail generation to compare listing performance
Browse files Browse the repository at this point in the history
  • Loading branch information
JustFanta01 committed Sep 9, 2024
1 parent 7110a54 commit e05f206
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -480,12 +480,18 @@ abstract class CryptoImplDecorator(
val firstCryptoFile = list.find { it is CryptoFile } ?: return list
val cloudType = (firstCryptoFile as CryptoFile).cloudFile.cloud?.type() ?: return list
val diskCache = getLruCacheFor(cloudType) ?: return list
list.onEach { cryptoNode ->
list.forEach { cryptoNode ->
if (cryptoNode is CryptoFile && isImageMediaType(cryptoNode.name)) {
val cacheKey = generateCacheKey(cryptoNode.cloudFile)
val cacheFile = diskCache[cacheKey]
if (cacheFile != null) {
cryptoNode.thumbnail = cacheFile
} else {
// TODO
// force thumbnail generation (~PER FOLDER)
val trash = File.createTempFile(cryptoNode.name, ".temp", internalCache)
read(cryptoNode, trash.outputStream(), ProgressAware.NO_OP_PROGRESS_AWARE_DOWNLOAD)
trash.delete()
}
}
}
Expand Down

0 comments on commit e05f206

Please sign in to comment.