Conversation
6f322b4 to
72d55fa
Compare
|
|
||
| private const val SPACE_SPECIAL_PREVIEW_URI = "%s?scalingup=0&a=1&x=%d&y=%d&c=%s&preview=1" | ||
| private const val FILE_PREVIEW_URI = "%s%s?x=%d&y=%d&c=%s&preview=1&id=%s" | ||
| private const val FILE_PREVIEW_URI = "%s/remote.php/webdav%s?x=%d&y=%d&c=%s&preview=1" |
There was a problem hiding this comment.
I don't think this looks good, OpenCloud is not PHP anymore.
I haven't really looked at the code yet. Where is stuff cached? From the names it seems it was Disk(Lru) before, what is it now? |
|
FYI I'm looking / testing this PR now. @zerox80 |
|
Hi, ill take a look now, was busy sorry |
|
re-test please @guruz |
We completely moved away from the old manual DiskLruCache handling and now rely on Coil's built-in caching mechanism, which is much more efficient and modern. It uses a two-tier caching strategy (both Memory and Disk cache), which is configured centrally in the ThumbnailsRequester.kt Disk Cache: We use Coil's DiskCache.Builder() to store thumbnails in the app's cache directory (thumbnails_coil_cache). It is explicitly limited to 100MB to ensure it doesn't inflate the app storage endlessly. (Location: appContext.cacheDir.resolve("thumbnails_coil_cache")) Memory Cache: We use Coil's MemoryCache.Builder() configured to use up to 25% of the available application memory (maxSizePercent(0.25)). This drastically improves scrolling performance in lists/grids because decoded images are kept directly in memory. Both caches are shared as Singletons (sharedDiskCache and sharedMemoryCache) and passed to the ImageLoader instance, so the caching rules apply globally to all thumbnail requests handled by Coil |
This commit acts as a squash of the thumbnail cache refactoring and avatar fixes. See PR description for full details.
- Update FILE_PREVIEW_URI to use direct native /webdav path. - Use Graph API explicitly for fetching Avatar image, dropping the /index.php/avatar hack & interceptor fallbacks.
a5268f3 to
a5e37bc
Compare
Thumbnail Cache Refactoring and Avatar Fixes
Summary
This pull request refactors the thumbnail caching mechanism to improve performance and stability, and includes critical fixes for user avatar loading. The legacy
ThumbnailsCacheManagerhas been replaced by an optimizedThumbnailsRequesterimplementation, and several thread safety issues have been resolved.Technical Details
Thumbnail Caching
ThumbnailsCacheManagerandDiskLruImageCachein favor of a modern, streamlined approach withinThumbnailsRequester.ThumbnailsRequesterwhen initializing the shared disk and memory caches. Access to these caches is now properly synchronized.Avatar Loading
Other Changes
Impact
These changes significantly reduce the maintenance burden by removing complex legacy caching code and provide a smoother user experience with faster and more reliable thumbnail and avatar loading.
Testing