refactor: sync

This commit is contained in:
shenlong-tanwen
2024-09-15 20:02:09 +05:30
parent 37b15869d5
commit ded4481190
20 changed files with 307 additions and 86 deletions
@@ -1,15 +1,26 @@
import 'dart:async';
import 'package:immich_mobile/domain/models/asset.model.dart';
import 'package:immich_mobile/domain/models/render_list.model.dart';
abstract class IAssetRepository {
/// Batch insert asset
Future<bool> addAll(Iterable<Asset> assets);
FutureOr<bool> addAll(Iterable<Asset> assets);
/// Removes assets with the [localIds]
FutureOr<List<Asset>> fetchLocalAssetsForIds(List<String> localIds);
/// Removes assets with the [remoteIds]
FutureOr<List<Asset>> fetchRemoteAssetsForIds(List<String> remoteIds);
/// Removes assets with the given [ids]
FutureOr<void> deleteAssetsForIds(List<int> ids);
/// Removes all assets
Future<bool> clearAll();
FutureOr<bool> clearAll();
/// Fetch assets from the [offset] with the [limit]
Future<List<Asset>> fetchAssets({int? offset, int? limit});
FutureOr<List<Asset>> fetchAssets({int? offset, int? limit});
/// Streams assets as groups grouped by the group type passed
Stream<RenderList> watchRenderList();