immich/mobile/lib/providers/infrastructure/trash_sync.provider.dart
Adam Gastineau 225ca9ab8d
chore(mobile): use Drift @DriftAccessor() and collapse some providers (#30693)
* chore(mobile): use Drift @DriftAccessor() and collapse some providers

* Fix import order

* Required formatting
2026-08-17 14:43:32 -07:00

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]));
});