mirror of
https://github.com/immich-app/immich
synced 2026-08-22 13:13:05 +00:00
* chore(mobile): use Drift @DriftAccessor() and collapse some providers * Fix import order * Required formatting
12 lines
549 B
Dart
12 lines
549 B
Dart
import 'package:async/async.dart';
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
import 'package:immich_mobile/providers/infrastructure/db.provider.dart';
|
|
|
|
typedef TrashedAssetsCount = ({int total, int hashed});
|
|
|
|
final trashedAssetsCountProvider = StreamProvider<TrashedAssetsCount>((ref) {
|
|
final repo = ref.watch(driftProvider).trashedLocalAssetRepository;
|
|
final total$ = repo.watchCount();
|
|
final hashed$ = repo.watchHashedCount();
|
|
return StreamZip<int>([total$, hashed$]).map((values) => (total: values[0], hashed: values[1]));
|
|
});
|