From 8c57ff36b442aa36a846252204c3226b9b2d121c Mon Sep 17 00:00:00 2001 From: Damontecres Date: Fri, 15 May 2026 16:59:08 -0400 Subject: [PATCH] Prefetch images for slideshow --- app/src/main/AndroidManifest.xml | 3 ++- .../components/image/ImageDetailsViewModel.kt | 20 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 1d046db96..f2f9857b4 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -29,7 +29,8 @@ android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/Theme.StashAppAndroidTV" - android:usesCleartextTraffic="true"> + android:usesCleartextTraffic="true" + android:largeHeap="true"> + Timber.v("Prefetching %s", nextImage.id) + val request = + ImageRequest + .Builder(StashApplication.getApplication()) + .data(nextImage.paths.image) + .size(Size.ORIGINAL) + .build() + StashApplication.getApplication().imageLoader.enqueue(request) + } + } catch (ex: Exception) { + Timber.e(ex, "Error prefetching image") + } + } } catch (ex: Exception) { loadingState.value = ImageLoadingState.Error LoggingCoroutineExceptionHandler(