mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
chore(server) refactor serveFile and downloadFile endpoint (#978)
This commit is contained in:
parent
1db255fd3e
commit
e799f35dd2
19 changed files with 116 additions and 175 deletions
|
|
@ -7,7 +7,6 @@
|
|||
import Keydown from 'svelte-keydown';
|
||||
|
||||
export let assetId: string;
|
||||
export let deviceId: string;
|
||||
|
||||
let assetInfo: AssetResponseDto;
|
||||
let assetData: string;
|
||||
|
|
@ -25,15 +24,9 @@
|
|||
|
||||
const loadAssetData = async () => {
|
||||
try {
|
||||
const { data } = await api.assetApi.serveFile(
|
||||
assetInfo.deviceAssetId,
|
||||
deviceId,
|
||||
false,
|
||||
true,
|
||||
{
|
||||
responseType: 'blob'
|
||||
}
|
||||
);
|
||||
const { data } = await api.assetApi.serveFile(assetInfo.id, false, true, {
|
||||
responseType: 'blob'
|
||||
});
|
||||
|
||||
if (!(data instanceof Blob)) {
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue