3053cbd4c8
* save thumbnails in subdirectories * migration job, migrate assets and face thumbnails * fix tests * directory depth of two instead of three * cleanup empty dirs after migration * clean up empty dirs after migration, migrate people without assetId * add job card for new migration job * fix removeEmptyDirs race condition because of missing await * cleanup empty directories after asset deletion * move ensurePath to storage core * rename jobs * remove unnecessary property of IEntityJob * use updated person getById, minor refactoring * ensure that directory cleanup doesn't interfere with migration * better description for job in ui * fix remove directories when migration is done * cleanup empty folders at start of migration * fix: actually persist concurrency setting * add comment explaining regex * chore: cleanup --------- Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
38 lines
1.2 KiB
TypeScript
38 lines
1.2 KiB
TypeScript
import { Stats } from 'fs';
|
|
import { Readable } from 'stream';
|
|
import { CrawlOptionsDto } from '../library';
|
|
|
|
export interface ImmichReadStream {
|
|
stream: Readable;
|
|
type?: string;
|
|
length?: number;
|
|
}
|
|
|
|
export interface ImmichZipStream extends ImmichReadStream {
|
|
addFile: (inputPath: string, filename: string) => void;
|
|
finalize: () => Promise<void>;
|
|
}
|
|
|
|
export interface DiskUsage {
|
|
available: number;
|
|
free: number;
|
|
total: number;
|
|
}
|
|
|
|
export const IStorageRepository = 'IStorageRepository';
|
|
|
|
export interface IStorageRepository {
|
|
createZipStream(): ImmichZipStream;
|
|
createReadStream(filepath: string, mimeType?: string | null): Promise<ImmichReadStream>;
|
|
unlink(filepath: string): Promise<void>;
|
|
unlinkDir(folder: string, options?: { recursive?: boolean; force?: boolean }): Promise<void>;
|
|
removeEmptyDirs(folder: string, self?: boolean): Promise<void>;
|
|
moveFile(source: string, target: string): Promise<void>;
|
|
checkFileExists(filepath: string, mode?: number): Promise<boolean>;
|
|
mkdirSync(filepath: string): void;
|
|
checkDiskUsage(folder: string): Promise<DiskUsage>;
|
|
readdir(folder: string): Promise<string[]>;
|
|
stat(filepath: string): Promise<Stats>;
|
|
crawl(crawlOptions: CrawlOptionsDto): Promise<string[]>;
|
|
}
|