mirror of
https://github.com/immich-app/immich.git
synced 2025-06-02 13:14:54 -04:00
14 lines
498 B
TypeScript
14 lines
498 B
TypeScript
const _basePath = '/api';
|
|
|
|
export function getFileUrl(aid: string, did: string, isThumb?: boolean, isWeb?: boolean) {
|
|
const urlObj = new URL(`${window.location.origin}${_basePath}/asset/file`);
|
|
|
|
urlObj.searchParams.append('aid', aid);
|
|
urlObj.searchParams.append('did', did);
|
|
if (isThumb !== undefined && isThumb !== null)
|
|
urlObj.searchParams.append('isThumb', `${isThumb}`);
|
|
if (isWeb !== undefined && isWeb !== null) urlObj.searchParams.append('isWeb', `${isWeb}`);
|
|
|
|
return urlObj.href;
|
|
}
|