mirror of
https://github.com/immich-app/immich.git
synced 2025-01-01 16:41:59 +00:00
4a1ff6abce
* refactor(mobile): repositories for album service * review feedback, first service unit test
20 lines
651 B
Dart
20 lines
651 B
Dart
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
import 'package:immich_mobile/entities/backup_album.entity.dart';
|
|
import 'package:immich_mobile/interfaces/backup.interface.dart';
|
|
import 'package:immich_mobile/providers/db.provider.dart';
|
|
import 'package:isar/isar.dart';
|
|
|
|
final backupRepositoryProvider =
|
|
Provider((ref) => BackupRepository(ref.watch(dbProvider)));
|
|
|
|
class BackupRepository implements IBackupRepository {
|
|
final Isar _db;
|
|
|
|
BackupRepository(
|
|
this._db,
|
|
);
|
|
|
|
@override
|
|
Future<List<String>> getIdsBySelection(BackupSelection backup) =>
|
|
_db.backupAlbums.filter().selectionEqualTo(backup).idProperty().findAll();
|
|
}
|