mirror of
https://github.com/anidl/multi-downloader-nx.git
synced 2026-03-11 17:45:30 +00:00
[CR] Fixes subtitles when directory doesn't exist
Now creates the directory before making the files, similar to how videos work.
This commit is contained in:
parent
ec8d8b3ab8
commit
7be22ec132
1 changed files with 6 additions and 0 deletions
|
|
@ -1832,6 +1832,12 @@ export default class Crunchy implements ServiceClass {
|
|||
const isCC = langItem.code === audDub;
|
||||
sxData.file = langsData.subsFile(fileName as string, subsIndex, langItem, isCC, options.ccTag);
|
||||
sxData.path = path.join(this.cfg.dir.content, sxData.file);
|
||||
const split = sxData.path.split(path.sep).slice(0, -1);
|
||||
split.forEach((val, ind, arr) => {
|
||||
const isAbsolut = path.isAbsolute(sxData.path as string);
|
||||
if (!fs.existsSync(path.join(isAbsolut ? '' : this.cfg.dir.content, ...arr.slice(0, ind), val)))
|
||||
fs.mkdirSync(path.join(isAbsolut ? '' : this.cfg.dir.content, ...arr.slice(0, ind), val));
|
||||
});
|
||||
if (files.some(a => a.type === 'Subtitle' && (a.language.cr_locale == langItem.cr_locale || a.language.locale == langItem.locale) && a.cc === isCC))
|
||||
continue;
|
||||
if(options.dlsubs.includes('all') || options.dlsubs.includes(langItem.locale)){
|
||||
|
|
|
|||
Loading…
Reference in a new issue