mirror of
https://github.com/zoriya/flood.git
synced 2026-06-05 11:49:24 +00:00
feature: allow to create torrents via Flood
This commit is contained in:
@@ -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));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user