mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
Add cache for shared albums
This commit is contained in:
@@ -5,8 +5,8 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:immich_mobile/modules/home/services/asset_cache.service.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
class AlbumCacheService extends JsonCache<List<AlbumResponseDto>> {
|
||||
AlbumCacheService() : super("album_cache");
|
||||
class BaseAlbumCacheService extends JsonCache<List<AlbumResponseDto>> {
|
||||
BaseAlbumCacheService(super.cacheFileName);
|
||||
|
||||
@override
|
||||
void put(List<AlbumResponseDto> data) {
|
||||
@@ -29,9 +29,21 @@ class AlbumCacheService extends JsonCache<List<AlbumResponseDto>> {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class AlbumCacheService extends BaseAlbumCacheService {
|
||||
AlbumCacheService() : super("album_cache");
|
||||
}
|
||||
|
||||
class SharedAlbumCacheService extends BaseAlbumCacheService {
|
||||
SharedAlbumCacheService() : super("shared_album_cache");
|
||||
}
|
||||
|
||||
final albumCacheServiceProvider = Provider(
|
||||
(ref) => AlbumCacheService(),
|
||||
);
|
||||
|
||||
final sharedAlbumCacheServiceProvider = Provider(
|
||||
(ref) => SharedAlbumCacheService(),
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user