mirror of
https://github.com/anidl/multi-downloader-nx.git
synced 2026-05-11 12:30:35 +00:00
Feat:Separate Temporary Download Directory and Final Output Directory anidl#1221
This commit is contained in:
parent
67ad1bc389
commit
e2172b1f68
1 changed files with 20 additions and 1 deletions
21
hidive.ts
21
hidive.ts
|
|
@ -1117,10 +1117,29 @@ export default class Hidive implements ServiceClass {
|
|||
console.info('Subtitles downloading skipped!');
|
||||
}
|
||||
|
||||
console.info('\x1b[32m[MDNX] All stream downloads & decryption completed.\x1b[0m');
|
||||
|
||||
let finalOutBase = './unknown';
|
||||
if (fileName) {
|
||||
let targetDir = this.cfg.dir.content;
|
||||
|
||||
if (options.outputDir) {
|
||||
const parsedDir = parseFileName(options.outputDir, variables, options.numbers, options.override).join(path.sep);
|
||||
targetDir = path.isAbsolute(parsedDir) ? parsedDir : path.join(this.cfg.dir.content, parsedDir);
|
||||
|
||||
if (!fs.existsSync(targetDir)) {
|
||||
fs.mkdirSync(targetDir, { recursive: true });
|
||||
}
|
||||
}
|
||||
|
||||
const finalNamePart = path.isAbsolute(fileName) ? path.basename(fileName) : fileName;
|
||||
finalOutBase = path.join(targetDir, finalNamePart);
|
||||
}
|
||||
|
||||
return {
|
||||
error: dlFailed,
|
||||
data: files,
|
||||
fileName: fileName ? (path.isAbsolute(fileName) ? fileName : path.join(this.cfg.dir.content, fileName)) || './unknown' : './unknown'
|
||||
fileName: finalOutBase
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue