mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
11 lines
418 B
TypeScript
11 lines
418 B
TypeScript
const _basePath = '/api';
|
|
|
|
export function getFileUrl(assetId: string, isThumb?: boolean, isWeb?: boolean) {
|
|
const urlObj = new URL(`${window.location.origin}${_basePath}/asset/file/${assetId}`);
|
|
|
|
if (isThumb !== undefined && isThumb !== null)
|
|
urlObj.searchParams.append('isThumb', `${isThumb}`);
|
|
if (isWeb !== undefined && isWeb !== null) urlObj.searchParams.append('isWeb', `${isWeb}`);
|
|
|
|
return urlObj.href;
|
|
}
|