more refactors and logs page handling
This commit is contained in:
@@ -4,14 +4,14 @@ import 'package:immich_mobile/domain/models/album.model.dart';
|
||||
|
||||
abstract interface class IAlbumRepository {
|
||||
/// Inserts a new album into the DB or updates if existing and returns the updated data
|
||||
FutureOr<Album?> upsert(Album album);
|
||||
Future<Album?> upsert(Album album);
|
||||
|
||||
/// Fetch all albums
|
||||
FutureOr<List<Album>> getAll({bool localOnly, bool remoteOnly});
|
||||
Future<List<Album>> getAll({bool localOnly, bool remoteOnly});
|
||||
|
||||
/// Removes album with the given [id]
|
||||
FutureOr<void> deleteId(int id);
|
||||
Future<void> deleteId(int id);
|
||||
|
||||
/// Removes all albums
|
||||
FutureOr<void> deleteAll();
|
||||
Future<void> deleteAll();
|
||||
}
|
||||
|
||||
@@ -4,17 +4,17 @@ import 'package:immich_mobile/domain/models/asset.model.dart';
|
||||
|
||||
abstract interface class IAlbumToAssetRepository {
|
||||
/// Link a list of assetIds to the given albumId
|
||||
FutureOr<bool> addAssetIds(int albumId, Iterable<int> assetIds);
|
||||
Future<bool> addAssetIds(int albumId, Iterable<int> assetIds);
|
||||
|
||||
/// Returns assets that are only part of the given album and nothing else
|
||||
FutureOr<List<int>> getAssetIdsOnlyInAlbum(int albumId);
|
||||
Future<List<int>> getAssetIdsOnlyInAlbum(int albumId);
|
||||
|
||||
/// Returns the assets for the given [albumId]
|
||||
FutureOr<List<Asset>> getAssetsForAlbum(int albumId);
|
||||
Future<List<Asset>> getAssetsForAlbum(int albumId);
|
||||
|
||||
/// Removes album with the given [albumId]
|
||||
FutureOr<void> deleteAlbumId(int albumId);
|
||||
Future<void> deleteAlbumId(int albumId);
|
||||
|
||||
/// Removes all album to asset mappings
|
||||
FutureOr<void> deleteAll();
|
||||
Future<void> deleteAll();
|
||||
}
|
||||
|
||||
@@ -4,11 +4,11 @@ import 'package:immich_mobile/domain/models/album_etag.model.dart';
|
||||
|
||||
abstract interface class IAlbumETagRepository {
|
||||
/// Inserts or updates the album etag for the given [albumId]
|
||||
FutureOr<bool> upsert(AlbumETag albumETag);
|
||||
Future<bool> upsert(AlbumETag albumETag);
|
||||
|
||||
/// Fetches the album etag for the given [albumId]
|
||||
FutureOr<AlbumETag?> get(int albumId);
|
||||
Future<AlbumETag?> get(int albumId);
|
||||
|
||||
/// Removes all album eTags
|
||||
FutureOr<void> deleteAll();
|
||||
Future<void> deleteAll();
|
||||
}
|
||||
|
||||
@@ -4,23 +4,23 @@ import 'package:immich_mobile/domain/models/asset.model.dart';
|
||||
|
||||
abstract interface class IAssetRepository {
|
||||
/// Batch upsert asset
|
||||
FutureOr<bool> upsertAll(Iterable<Asset> assets);
|
||||
Future<bool> upsertAll(Iterable<Asset> assets);
|
||||
|
||||
/// Removes assets with the [localIds]
|
||||
FutureOr<List<Asset>> getForLocalIds(Iterable<String> localIds);
|
||||
Future<List<Asset>> getForLocalIds(Iterable<String> localIds);
|
||||
|
||||
/// Removes assets with the [remoteIds]
|
||||
FutureOr<List<Asset>> getForRemoteIds(Iterable<String> remoteIds);
|
||||
Future<List<Asset>> getForRemoteIds(Iterable<String> remoteIds);
|
||||
|
||||
/// Get assets with the [hashes]
|
||||
FutureOr<List<Asset>> getForHashes(Iterable<String> hashes);
|
||||
Future<List<Asset>> getForHashes(Iterable<String> hashes);
|
||||
|
||||
/// Fetch assets from the [offset] with the [limit]
|
||||
FutureOr<List<Asset>> getAll({int? offset, int? limit});
|
||||
Future<List<Asset>> getAll({int? offset, int? limit});
|
||||
|
||||
/// Removes assets with the given [ids]
|
||||
FutureOr<void> deleteIds(Iterable<int> ids);
|
||||
Future<void> deleteIds(Iterable<int> ids);
|
||||
|
||||
/// Removes all assets
|
||||
FutureOr<bool> deleteAll();
|
||||
Future<bool> deleteAll();
|
||||
}
|
||||
|
||||
@@ -5,13 +5,13 @@ import 'package:immich_mobile/domain/models/asset.model.dart';
|
||||
|
||||
abstract interface class IDeviceAlbumRepository {
|
||||
/// Fetches all [Album] from device
|
||||
FutureOr<List<Album>> getAll();
|
||||
Future<List<Album>> getAll();
|
||||
|
||||
/// Returns the number of asset in the album
|
||||
FutureOr<int> getAssetCount(String albumId);
|
||||
Future<int> getAssetCount(String albumId);
|
||||
|
||||
/// Fetches assets belong to the albumId
|
||||
FutureOr<List<Asset>> getAssetsForAlbum(
|
||||
Future<List<Asset>> getAssetsForAlbum(
|
||||
String albumId, {
|
||||
int start = 0,
|
||||
int end = 0x7fffffffffffffff,
|
||||
|
||||
@@ -8,10 +8,10 @@ import 'package:immich_mobile/utils/constants/globals.dart';
|
||||
|
||||
abstract interface class IDeviceAssetRepository<T> {
|
||||
/// Fetches the [File] for the given [assetId]
|
||||
FutureOr<File?> getOriginalFile(String assetId);
|
||||
Future<File?> getOriginalFile(String assetId);
|
||||
|
||||
/// Fetches the thumbnail for the given [assetId]
|
||||
FutureOr<Uint8List?> getThumbnail(
|
||||
Future<Uint8List?> getThumbnail(
|
||||
String assetId, {
|
||||
int width = kGridThumbnailSize,
|
||||
int height = kGridThumbnailSize,
|
||||
|
||||
@@ -4,11 +4,11 @@ import 'package:immich_mobile/domain/models/device_asset_hash.model.dart';
|
||||
|
||||
abstract interface class IDeviceAssetToHashRepository {
|
||||
/// Add a new device asset to hash entry
|
||||
FutureOr<bool> upsertAll(Iterable<DeviceAssetToHash> assetHash);
|
||||
Future<bool> upsertAll(Iterable<DeviceAssetToHash> assetHash);
|
||||
|
||||
// Gets the asset with the local ID from the device
|
||||
FutureOr<List<DeviceAssetToHash>> getForIds(Iterable<String> localIds);
|
||||
Future<List<DeviceAssetToHash>> getForIds(Iterable<String> localIds);
|
||||
|
||||
/// Removes assets with the given [ids]
|
||||
FutureOr<void> deleteIds(Iterable<int> ids);
|
||||
Future<void> deleteIds(Iterable<int> ids);
|
||||
}
|
||||
|
||||
@@ -4,17 +4,17 @@ import 'package:immich_mobile/domain/models/log.model.dart';
|
||||
|
||||
abstract interface class ILogRepository {
|
||||
/// Inserts a new log into the DB
|
||||
FutureOr<bool> create(LogMessage log);
|
||||
Future<bool> create(LogMessage log);
|
||||
|
||||
/// Bulk insert logs into DB
|
||||
FutureOr<bool> createAll(Iterable<LogMessage> log);
|
||||
Future<bool> createAll(Iterable<LogMessage> log);
|
||||
|
||||
/// Fetches all logs
|
||||
FutureOr<List<LogMessage>> getAll();
|
||||
Future<List<LogMessage>> getAll();
|
||||
|
||||
/// Clears all logs
|
||||
FutureOr<bool> deleteAll();
|
||||
Future<bool> deleteAll();
|
||||
|
||||
/// Truncates the logs to the most recent [limit]. Defaults to recent 250 logs
|
||||
FutureOr<void> truncate({int limit = 250});
|
||||
Future<void> truncate({int limit = 250});
|
||||
}
|
||||
|
||||
@@ -13,15 +13,15 @@ abstract class IStoreConverter<T, U> {
|
||||
}
|
||||
|
||||
abstract interface class IStoreRepository {
|
||||
FutureOr<bool> upsert<T, U>(StoreKey<T, U> key, T value);
|
||||
Future<bool> upsert<T, U>(StoreKey<T, U> key, T value);
|
||||
|
||||
FutureOr<T> get<T, U>(StoreKey<T, U> key);
|
||||
Future<T> get<T, U>(StoreKey<T, U> key);
|
||||
|
||||
FutureOr<T?> tryGet<T, U>(StoreKey<T, U> key);
|
||||
Future<T?> tryGet<T, U>(StoreKey<T, U> key);
|
||||
|
||||
Stream<T?> watch<T, U>(StoreKey<T, U> key);
|
||||
|
||||
FutureOr<void> delete(StoreKey key);
|
||||
Future<void> delete(StoreKey key);
|
||||
|
||||
FutureOr<void> deleteAll();
|
||||
Future<void> deleteAll();
|
||||
}
|
||||
|
||||
@@ -4,11 +4,11 @@ import 'package:immich_mobile/domain/models/user.model.dart';
|
||||
|
||||
abstract interface class IUserRepository {
|
||||
/// Insert user
|
||||
FutureOr<bool> upsert(User user);
|
||||
Future<bool> upsert(User user);
|
||||
|
||||
/// Fetches user
|
||||
FutureOr<User?> getForId(String userId);
|
||||
Future<User?> getForId(String userId);
|
||||
|
||||
/// Removes all users
|
||||
FutureOr<void> deleteAll();
|
||||
Future<void> deleteAll();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user