immich/mobile/lib/providers/infrastructure/trash_sync.provider.dart
Peter Ombodi ebfab4b01b sync_stream.service depend on repos
refactor assets restoration
update dependencies in tests
2025-10-07 14:18:45 +03:00

12 lines
538 B
Dart

import 'package:async/async.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:immich_mobile/providers/infrastructure/asset.provider.dart';
typedef TrashedAssetsCount = ({int total, int hashed});
final trashedAssetsCountProvider = StreamProvider<TrashedAssetsCount>((ref) {
final repo = ref.watch(trashedLocalAssetRepository);
final total$ = repo.watchCount();
final hashed$ = repo.watchHashedCount();
return StreamZip<int>([total$, hashed$]).map((values) => (total: values[0], hashed: values[1]));
});