fix(mobile): Fixes memory image cache for local images (#9019)

* Fixes equality operator for immich local image provider

* Changes image cache manager to no longer be image cache managers

* Updates large image cache to 12 images

format

* Try 5 Image cache

---------

Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
martyfuhry
2024-04-25 00:30:32 -04:00
committed by GitHub
parent 2943f93098
commit 732bd1e652
7 changed files with 18 additions and 12 deletions

View File

@@ -13,7 +13,7 @@ import 'package:immich_mobile/shared/models/store.dart';
class ImageLoader {
static Future<ui.Codec> loadImageFromCache(
String uri, {
required ImageCacheManager cache,
required CacheManager cache,
required ImageDecoderCallback decode,
StreamController<ImageChunkEvent>? chunkEvents,
}) async {
@@ -21,7 +21,7 @@ class ImageLoader {
'x-immich-user-token': Store.get(StoreKey.accessToken),
};
final stream = cache.getImageFile(
final stream = cache.getFileStream(
uri,
withProgress: chunkEvents != null,
headers: headers,

View File

@@ -1,7 +1,7 @@
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
/// The cache manager for full size images [ImmichRemoteImageProvider]
class RemoteImageCacheManager extends CacheManager with ImageCacheManager {
class RemoteImageCacheManager extends CacheManager {
static const key = 'remoteImageCacheKey';
static final RemoteImageCacheManager _instance = RemoteImageCacheManager._();

View File

@@ -1,7 +1,7 @@
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
/// The cache manager for thumbnail images [ImmichRemoteThumbnailProvider]
class ThumbnailImageCacheManager extends CacheManager with ImageCacheManager {
class ThumbnailImageCacheManager extends CacheManager {
static const key = 'thumbnailImageCacheKey';
static final ThumbnailImageCacheManager _instance =
ThumbnailImageCacheManager._();