refactor: infra folder (#8138)

This commit is contained in:
Jason Rasmussen
2024-03-20 22:15:09 -05:00
committed by GitHub
parent 9fd5d2ad9c
commit 16d0df796c
139 changed files with 968 additions and 1164 deletions

25
server/src/utils/file.ts Normal file
View File

@@ -0,0 +1,25 @@
import { basename, extname } from 'node:path';
export function getFileNameWithoutExtension(path: string): string {
return basename(path, extname(path));
}
export function getLivePhotoMotionFilename(stillName: string, motionName: string) {
return getFileNameWithoutExtension(stillName) + extname(motionName);
}
export enum CacheControl {
PRIVATE_WITH_CACHE = 'private_with_cache',
PRIVATE_WITHOUT_CACHE = 'private_without_cache',
NONE = 'none',
}
export class ImmichFileResponse {
public readonly path!: string;
public readonly contentType!: string;
public readonly cacheControl!: CacheControl;
constructor(response: ImmichFileResponse) {
Object.assign(this, response);
}
}