feature: allow to create torrents via Flood

This commit is contained in:
Jesse Chan
2020-10-09 19:13:37 +08:00
parent 3610c9ef8d
commit e0e68a19df
19 changed files with 609 additions and 98 deletions
+7 -13
View File
@@ -3,18 +3,12 @@ import path from 'path';
import {tempPath} from '../../config';
class TemporaryStorage {
constructor() {
fs.mkdirSync(tempPath, {recursive: true});
}
fs.mkdirSync(tempPath, {recursive: true});
static deleteFile(filename: string): void {
fs.unlinkSync(TemporaryStorage.getTempPath(filename));
}
export const getTempPath = (filename: string): string => {
return path.join(tempPath, filename);
};
static getTempPath(filename: string): string {
return path.join(tempPath, filename);
}
}
export default new TemporaryStorage();
export const deleteFile = (filename: string): void => {
fs.unlinkSync(getTempPath(filename));
};