mirror of
https://github.com/immich-app/immich.git
synced 2025-03-01 15:11:21 +01:00
14 lines
608 B
TypeScript
14 lines
608 B
TypeScript
import { AssetResponseDto, mapAsset } from 'src/dtos/asset-response.dto';
|
|
import { AuthDto } from 'src/dtos/auth.dto';
|
|
import { BaseService } from 'src/services/base.service';
|
|
|
|
export class ViewService extends BaseService {
|
|
getUniqueOriginalPaths(auth: AuthDto): Promise<string[]> {
|
|
return this.viewRepository.getUniqueOriginalPaths(auth.user.id);
|
|
}
|
|
|
|
async getAssetsByOriginalPath(auth: AuthDto, path: string): Promise<AssetResponseDto[]> {
|
|
const assets = await this.viewRepository.getAssetsByOriginalPath(auth.user.id, path);
|
|
return assets.map((asset) => mapAsset(asset, { auth }));
|
|
}
|
|
}
|