mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
* feat: explore * chore: generate open api * styling explore page * styling no result page * style overlay * style: bluring text on thumbnail card for readability * explore page tweaks * fix(web): search urls * feat(web): use objects for things * feat(server): filter by motion, sort by createdAt * More styling * better navigation --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com> Co-authored-by: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com>
21 lines
841 B
TypeScript
21 lines
841 B
TypeScript
import { AssetEntity, AssetType } from '@app/infra/db/entities';
|
|
import { IJobRepository, JobName } from '../job';
|
|
import { AssetSearchOptions, IAssetRepository } from './asset.repository';
|
|
|
|
export class AssetCore {
|
|
constructor(private assetRepository: IAssetRepository, private jobRepository: IJobRepository) {}
|
|
|
|
getAll(options: AssetSearchOptions) {
|
|
return this.assetRepository.getAll(options);
|
|
}
|
|
|
|
async save(asset: Partial<AssetEntity>) {
|
|
const _asset = await this.assetRepository.save(asset);
|
|
await this.jobRepository.queue({ name: JobName.SEARCH_INDEX_ASSET, data: { asset: _asset } });
|
|
return _asset;
|
|
}
|
|
|
|
findLivePhotoMatch(livePhotoCID: string, otherAssetId: string, type: AssetType): Promise<AssetEntity | null> {
|
|
return this.assetRepository.findLivePhotoMatch(livePhotoCID, otherAssetId, type);
|
|
}
|
|
}
|