mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
Add album list response caching
This commit is contained in:
@@ -17,7 +17,7 @@ class AssetNotifier extends StateNotifier<List<AssetResponseDto>> {
|
||||
AssetNotifier(this._assetService, this._assetCacheService) : super([]);
|
||||
|
||||
_cacheState() {
|
||||
_assetCacheService.putAssets(state);
|
||||
_assetCacheService.put(state);
|
||||
}
|
||||
|
||||
getAllAsset() async {
|
||||
@@ -26,7 +26,7 @@ class AssetNotifier extends StateNotifier<List<AssetResponseDto>> {
|
||||
|
||||
if (_assetCacheService.isValid() && state.isEmpty) {
|
||||
stopwatch.start();
|
||||
state = await _assetCacheService.getAssetsAsync();
|
||||
state = await _assetCacheService.getAsync();
|
||||
debugPrint("Reading assets from cache: ${stopwatch.elapsedMilliseconds}ms");
|
||||
stopwatch.reset();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user