|
|
|
|
@ -60,10 +60,9 @@ const details = () => ({
|
|
|
|
|
let foundAudioInLang = false;
|
|
|
|
|
let defaults = [] // list of tracks currently set as default
|
|
|
|
|
|
|
|
|
|
// 1, 2 jpn (default), 3 eng (default)
|
|
|
|
|
// [0,1,1]
|
|
|
|
|
// firstAudioIdx = 2
|
|
|
|
|
// convert = false
|
|
|
|
|
// 0 jpn (default), 1 eng (default)
|
|
|
|
|
// [true, true]
|
|
|
|
|
// firstAudioInLangIdx = 0
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < file.ffProbeData.streams.length; i++) {
|
|
|
|
|
try {
|
|
|
|
|
@ -71,9 +70,10 @@ const details = () => ({
|
|
|
|
|
defaults[audioIdx] = file.ffProbeData.streams[i].disposition.default === 1
|
|
|
|
|
// if we find an audio in the lang
|
|
|
|
|
if (languages.includes(file.ffProbeData.streams[i].tags.language)) {
|
|
|
|
|
// mark the id and break
|
|
|
|
|
firstAudioInLangIdx = audioIdx;
|
|
|
|
|
break;
|
|
|
|
|
// mark the id of the first track in lang
|
|
|
|
|
if (firstAudioInLangIdx === -1) {
|
|
|
|
|
firstAudioInLangIdx = audioIdx;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
audioIdx += 1;
|
|
|
|
|
}
|
|
|
|
|
|