mirror of
				https://github.com/immich-app/immich.git
				synced 2025-10-31 02:27:08 -04:00 
			
		
		
		
	* refactor: device asset entity to use modified time * chore: cleanup * refactor: remove album media dependency from hashservice * refactor: return updated copy of asset * add hash service tests * chore: rename hash batch constants * chore: log the number of assets processed during migration * chore: more logs * refactor: use lookup and more tests * use sort approach * refactor hash service to use for loop instead * refactor: rename to getByIds --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
		
			
				
	
	
		
			69 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			Dart
		
	
	
	
	
	
			
		
		
	
	
			69 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			Dart
		
	
	
	
	
	
| import 'package:immich_mobile/entities/album.entity.dart';
 | |
| import 'package:immich_mobile/entities/asset.entity.dart';
 | |
| import 'package:immich_mobile/interfaces/database.interface.dart';
 | |
| 
 | |
| abstract interface class IAssetRepository implements IDatabaseRepository {
 | |
|   Future<Asset?> getByRemoteId(String id);
 | |
| 
 | |
|   Future<Asset?> getByOwnerIdChecksum(int ownerId, String checksum);
 | |
| 
 | |
|   Future<List<Asset>> getAllByRemoteId(
 | |
|     Iterable<String> ids, {
 | |
|     AssetState? state,
 | |
|   });
 | |
| 
 | |
|   Future<List<Asset?>> getAllByOwnerIdChecksum(
 | |
|     List<int> ids,
 | |
|     List<String> checksums,
 | |
|   );
 | |
| 
 | |
|   Future<List<Asset>> getAll({
 | |
|     required String ownerId,
 | |
|     AssetState? state,
 | |
|     AssetSort? sortBy,
 | |
|     int? limit,
 | |
|   });
 | |
| 
 | |
|   Future<List<Asset>> getAllLocal();
 | |
| 
 | |
|   Future<List<Asset>> getByAlbum(
 | |
|     Album album, {
 | |
|     Iterable<String> notOwnedBy = const [],
 | |
|     String? ownerId,
 | |
|     AssetState? state,
 | |
|     AssetSort? sortBy,
 | |
|   });
 | |
| 
 | |
|   Future<Asset> update(Asset asset);
 | |
| 
 | |
|   Future<List<Asset>> updateAll(List<Asset> assets);
 | |
| 
 | |
|   Future<void> deleteAllByRemoteId(List<String> ids, {AssetState? state});
 | |
| 
 | |
|   Future<void> deleteByIds(List<int> ids);
 | |
| 
 | |
|   Future<List<Asset>> getMatches({
 | |
|     required List<Asset> assets,
 | |
|     required String ownerId,
 | |
|     AssetState? state,
 | |
|     int limit = 100,
 | |
|   });
 | |
| 
 | |
|   Future<void> upsertDuplicatedAssets(Iterable<String> duplicatedAssets);
 | |
| 
 | |
|   Future<List<String>> getAllDuplicatedAssetIds();
 | |
| 
 | |
|   Future<List<Asset>> getStackAssets(String stackId);
 | |
| 
 | |
|   Future<void> clearTable();
 | |
| 
 | |
|   Stream<Asset?> watchAsset(int id, {bool fireImmediately = false});
 | |
| 
 | |
|   Future<List<Asset>> getTrashAssets(String userId);
 | |
| 
 | |
|   Future<List<Asset>> getRecentlyAddedAssets(String userId);
 | |
|   Future<List<Asset>> getMotionAssets(String userId);
 | |
| }
 | |
| 
 | |
| enum AssetSort { checksum, ownerIdChecksum }
 |