mirror of
https://github.com/immich-app/immich.git
synced 2025-11-16 19:43:19 -05:00
* feat: show "appears in" albums on asset viewer bottom sheet fix: multiple RemoteAlbumPages in navigation stack this also allows us to not have to set the current album before navigating to RemoteAlbumPage chore: clarification comments handle nested album pages fix: hide "appears in" when an asset is not in any albums fix: way more bottom padding for some reason we can't query the safe area here :/ * fix: bottom sheet now is usable when navigating to another asset viewer * fix: rebase conflict * fix: restore ancestors album to currentRemoteAlbumProvider when popping * fix: view flashing when dismissing a album viewer * chore: code review changes * fix: styling and padding * chore: rework currentRemoteAlbumProvider to be scoped by the Remote album page * fix: override remote album provider on required pages * chore: convert query to all SQL calls instead of matching in Dart * fix: album query * fix: unawaited future * Update deep_link.service.dart --------- Co-authored-by: Alex <alex.tran1502@gmail.com>
48 lines
2.2 KiB
Dart
48 lines
2.2 KiB
Dart
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
import 'package:immich_mobile/domain/models/album/album.model.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';
|
|
import 'package:immich_mobile/providers/infrastructure/db.provider.dart';
|
|
import 'package:immich_mobile/providers/infrastructure/remote_album.provider.dart';
|
|
import 'package:immich_mobile/repositories/drift_album_api_repository.dart';
|
|
|
|
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(sortBy: {SortLocalAlbumsBy.newestAsset})
|
|
.then((albums) => albums.where((album) => album.assetCount > 0).toList()),
|
|
);
|
|
|
|
final localAlbumThumbnailProvider = FutureProvider.family<LocalAsset?, String>(
|
|
(ref, albumId) => LocalAlbumService(ref.watch(localAlbumRepository)).getThumbnail(albumId),
|
|
);
|
|
|
|
final remoteAlbumRepository = Provider<DriftRemoteAlbumRepository>(
|
|
(ref) => DriftRemoteAlbumRepository(ref.watch(driftProvider)),
|
|
);
|
|
|
|
final remoteAlbumServiceProvider = Provider<RemoteAlbumService>(
|
|
(ref) => RemoteAlbumService(ref.watch(remoteAlbumRepository), ref.watch(driftAlbumApiRepositoryProvider)),
|
|
dependencies: [remoteAlbumRepository],
|
|
);
|
|
|
|
final remoteAlbumProvider = NotifierProvider<RemoteAlbumNotifier, RemoteAlbumState>(
|
|
RemoteAlbumNotifier.new,
|
|
dependencies: [remoteAlbumServiceProvider],
|
|
);
|
|
|
|
final albumsContainingAssetProvider = FutureProvider.family<List<RemoteAlbum>, String>(
|
|
(ref, assetId) => ref.watch(remoteAlbumServiceProvider).getAlbumsContainingAsset(assetId),
|
|
);
|