mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
Add album list response caching
This commit is contained in:
parent
75d8ca1306
commit
d310c77fc8
7 changed files with 108 additions and 22 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue