mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
feat(mobile): drift local albums page (#19817)
* feat(mobile): drift local albums page * fix: lint * refactor: use AsyncValue * fix: lint * local album thumbnail --------- Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
parent
e703685d8d
commit
a556de67b0
9 changed files with 294 additions and 13 deletions
|
|
@ -1,4 +1,7 @@
|
|||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:immich_mobile/domain/models/album/local_album.model.dart';
|
||||
import 'package:immich_mobile/domain/models/asset/base_asset.model.dart';
|
||||
import 'package:immich_mobile/domain/services/local_album.service.dart';
|
||||
import 'package:immich_mobile/domain/services/remote_album.service.dart';
|
||||
import 'package:immich_mobile/infrastructure/repositories/local_album.repository.dart';
|
||||
import 'package:immich_mobile/infrastructure/repositories/remote_album.repository.dart';
|
||||
|
|
@ -9,6 +12,19 @@ final localAlbumRepository = Provider<DriftLocalAlbumRepository>(
|
|||
(ref) => DriftLocalAlbumRepository(ref.watch(driftProvider)),
|
||||
);
|
||||
|
||||
final localAlbumServiceProvider = Provider<LocalAlbumService>(
|
||||
(ref) => LocalAlbumService(ref.watch(localAlbumRepository)),
|
||||
);
|
||||
|
||||
final localAlbumProvider = FutureProvider<List<LocalAlbum>>(
|
||||
(ref) => LocalAlbumService(ref.watch(localAlbumRepository)).getAll(),
|
||||
);
|
||||
|
||||
final localAlbumThumbnailProvider = FutureProvider.family<LocalAsset?, String>(
|
||||
(ref, albumId) =>
|
||||
LocalAlbumService(ref.watch(localAlbumRepository)).getThumbnail(albumId),
|
||||
);
|
||||
|
||||
final remoteAlbumRepository = Provider<DriftRemoteAlbumRepository>(
|
||||
(ref) => DriftRemoteAlbumRepository(ref.watch(driftProvider)),
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue