mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
feat(server): CLIP search integration (#1939)
This commit is contained in:
@@ -11,7 +11,10 @@ export class AssetCore {
|
||||
|
||||
async save(asset: Partial<AssetEntity>) {
|
||||
const _asset = await this.assetRepository.save(asset);
|
||||
await this.jobRepository.queue({ name: JobName.SEARCH_INDEX_ASSET, data: { asset: _asset } });
|
||||
await this.jobRepository.queue({
|
||||
name: JobName.SEARCH_INDEX_ASSET,
|
||||
data: { ids: [_asset.id] },
|
||||
});
|
||||
return _asset;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ export interface AssetSearchOptions {
|
||||
export const IAssetRepository = 'IAssetRepository';
|
||||
|
||||
export interface IAssetRepository {
|
||||
getByIds(ids: string[]): Promise<AssetEntity[]>;
|
||||
deleteAll(ownerId: string): Promise<void>;
|
||||
getAll(options?: AssetSearchOptions): Promise<AssetEntity[]>;
|
||||
save(asset: Partial<AssetEntity>): Promise<AssetEntity>;
|
||||
|
||||
@@ -54,7 +54,7 @@ describe(AssetService.name, () => {
|
||||
expect(assetMock.save).toHaveBeenCalledWith(assetEntityStub.image);
|
||||
expect(jobMock.queue).toHaveBeenCalledWith({
|
||||
name: JobName.SEARCH_INDEX_ASSET,
|
||||
data: { asset: assetEntityStub.image },
|
||||
data: { ids: [assetEntityStub.image.id] },
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user