mirror of
https://github.com/immich-app/immich.git
synced 2025-12-20 09:15:35 +03:00
13 lines
502 B
TypeScript
13 lines
502 B
TypeScript
|
|
let _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;
|
||
|
|
}
|