fix: rework file handling so we always explicitly create, overwrite or both (#12812)

This commit is contained in:
Zack Pollard 2024-09-21 00:16:53 +01:00 committed by GitHub
parent af70111645
commit 5a1a841365
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 46 additions and 16 deletions

View file

@ -35,7 +35,9 @@ export interface IStorageRepository {
createZipStream(): ImmichZipStream;
createReadStream(filepath: string, mimeType?: string | null): Promise<ImmichReadStream>;
readFile(filepath: string, options?: FileReadOptions<Buffer>): Promise<Buffer>;
writeFile(filepath: string, buffer: Buffer): Promise<void>;
createFile(filepath: string, buffer: Buffer): Promise<void>;
createOrOverwriteFile(filepath: string, buffer: Buffer): Promise<void>;
overwriteFile(filepath: string, buffer: Buffer): Promise<void>;
realpath(filepath: string): Promise<string>;
unlink(filepath: string): Promise<void>;
unlinkDir(folder: string, options?: { recursive?: boolean; force?: boolean }): Promise<void>;