mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-27 00:33:09 +02:00
fix(server): clean up file in FileServer
This commit is contained in:
parent
110bbbc7dc
commit
faed3b438e
1 changed files with 4 additions and 0 deletions
|
@ -146,6 +146,8 @@ export class FileServerService {
|
||||||
const url = new URL(`${this.config.mediaProxy}/static.webp`);
|
const url = new URL(`${this.config.mediaProxy}/static.webp`);
|
||||||
url.searchParams.set('url', file.url);
|
url.searchParams.set('url', file.url);
|
||||||
url.searchParams.set('static', '1');
|
url.searchParams.set('static', '1');
|
||||||
|
|
||||||
|
file.cleanup();
|
||||||
return await reply.redirect(301, url.toString());
|
return await reply.redirect(301, url.toString());
|
||||||
} else if (file.mime.startsWith('video/')) {
|
} else if (file.mime.startsWith('video/')) {
|
||||||
image = await this.videoProcessingService.generateVideoThumbnail(file.path);
|
image = await this.videoProcessingService.generateVideoThumbnail(file.path);
|
||||||
|
@ -158,6 +160,8 @@ export class FileServerService {
|
||||||
|
|
||||||
const url = new URL(`${this.config.mediaProxy}/svg.webp`);
|
const url = new URL(`${this.config.mediaProxy}/svg.webp`);
|
||||||
url.searchParams.set('url', file.url);
|
url.searchParams.set('url', file.url);
|
||||||
|
|
||||||
|
file.cleanup();
|
||||||
return await reply.redirect(301, url.toString());
|
return await reply.redirect(301, url.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue