Fix copy progress, remove v2.0.0, fix subtitle default naming, enforce strict no-upcoding on audio
Build / Lint & Test (push) Successful in 3m15s
Build / Lint & Test (push) Successful in 3m15s
This commit is contained in:
1 parent
7ee5a5bc48
commit
86448988ed
12 files changed
+470
-348
No files matched your search
@@ -35,9 +35,16 @@ const normalizeSubtitleParts = (parts) => {
|
||||
const normalized = [];
|
||||
for (const part of parts) {
|
||||
const value = part.toLowerCase();
|
||||
if (LANGUAGE_CODES[value]) normalized.push(LANGUAGE_CODES[value]);
|
||||
else if (!normalized.includes(value)) normalized.push(value);
|
||||
if (LANGUAGE_CODES[value]) {
|
||||
normalized.push(LANGUAGE_CODES[value]);
|
||||
} else if (value === 'default') {
|
||||
// Discard 'default'; it will only be re-added below if it is ita + forced
|
||||
continue;
|
||||
} else if (!normalized.includes(value)) {
|
||||
normalized.push(value);
|
||||
}
|
||||
}
|
||||
// Only ita.forced can be marked as default; default must be removed from all other subtitles
|
||||
if (normalized.includes('ita') && normalized.includes('forced')
|
||||
&& !normalized.includes('default')) {
|
||||
normalized.splice(normalized.indexOf('forced') + 1, 0, 'default');
|
||||
@@ -151,9 +158,10 @@ const plugin = async (args) => {
|
||||
}
|
||||
|
||||
for (const item of metadata) {
|
||||
const isItaForced = item.language === 'ita' && item.forced;
|
||||
const expected = `${mediaBaseName}.${item.language}`
|
||||
+ (item.forced ? '.forced' : '')
|
||||
+ (item.forced || item.default ? '.default' : '')
|
||||
+ (isItaForced ? '.default' : '')
|
||||
+ (item.sdh ? '.sdh' : '') + '.srt';
|
||||
if (!fs.existsSync(path.join(finalDir, expected))) {
|
||||
jobLog(`[finalizeMedia] WARNING: Expected subtitle sidecar is missing: ${expected}\n`);
|
||||
|
||||
Reference in new issue
Block a user