2024-09-16 20:26:14 +00:00
|
|
|
import 'package:immich_mobile/entities/album.entity.dart';
|
|
|
|
import 'package:immich_mobile/entities/asset.entity.dart';
|
|
|
|
import 'package:immich_mobile/entities/user.entity.dart';
|
2024-09-30 14:37:30 +00:00
|
|
|
import 'package:immich_mobile/interfaces/database.interface.dart';
|
2024-10-10 08:44:14 +00:00
|
|
|
import 'package:immich_mobile/models/albums/album_search.model.dart';
|
2024-09-16 20:26:14 +00:00
|
|
|
|
2024-09-30 14:37:30 +00:00
|
|
|
abstract interface class IAlbumRepository implements IDatabaseRepository {
|
2024-09-16 20:26:14 +00:00
|
|
|
Future<Album> create(Album album);
|
2024-09-30 14:37:30 +00:00
|
|
|
|
|
|
|
Future<Album?> get(int id);
|
|
|
|
|
2024-09-16 20:26:14 +00:00
|
|
|
Future<Album?> getByName(
|
|
|
|
String name, {
|
|
|
|
bool? shared,
|
|
|
|
bool? remote,
|
|
|
|
});
|
2024-09-30 14:37:30 +00:00
|
|
|
|
|
|
|
Future<List<Album>> getAll({
|
|
|
|
bool? shared,
|
|
|
|
bool? remote,
|
|
|
|
int? ownerId,
|
|
|
|
AlbumSort? sortBy,
|
|
|
|
});
|
|
|
|
|
2024-09-16 20:26:14 +00:00
|
|
|
Future<Album> update(Album album);
|
2024-09-30 14:37:30 +00:00
|
|
|
|
2024-09-16 20:26:14 +00:00
|
|
|
Future<void> delete(int albumId);
|
2024-09-30 14:37:30 +00:00
|
|
|
|
|
|
|
Future<void> deleteAllLocal();
|
|
|
|
|
|
|
|
Future<int> count({bool? local});
|
|
|
|
|
|
|
|
Future<void> addUsers(Album album, List<User> users);
|
|
|
|
|
2024-09-16 20:26:14 +00:00
|
|
|
Future<void> removeUsers(Album album, List<User> users);
|
2024-09-30 14:37:30 +00:00
|
|
|
|
2024-09-16 20:26:14 +00:00
|
|
|
Future<void> addAssets(Album album, List<Asset> assets);
|
2024-09-30 14:37:30 +00:00
|
|
|
|
2024-09-16 20:26:14 +00:00
|
|
|
Future<void> removeAssets(Album album, List<Asset> assets);
|
2024-09-30 14:37:30 +00:00
|
|
|
|
2024-09-16 20:26:14 +00:00
|
|
|
Future<Album> recalculateMetadata(Album album);
|
2024-10-10 08:44:14 +00:00
|
|
|
|
|
|
|
Future<List<Album>> search(String searchTerm, QuickFilterMode filterMode);
|
2024-09-16 20:26:14 +00:00
|
|
|
}
|
2024-09-30 14:37:30 +00:00
|
|
|
|
|
|
|
enum AlbumSort { remoteId, localId }
|