Misc changes

This commit is contained in:
MrMeeb 2024-04-21 15:57:36 +00:00
parent 93ff21021c
commit 9e9906ffed

View File

@ -329,8 +329,8 @@ const plugin = (file, librarySettings, inputs, otherArguments) => {
//LOGIC NEEDS ADDING FOR IF AN AC3 TRACK HAS BEEN CREATED WITH FEWER THAN 6 CHANNELS
console.log(`Neither a TrueHD track or a desireable AC3 5.1 track exist. Selecting the first audio track and converting it to AC3.`)
response.infoLog += 'Neither a TrueHD track or a desireable AC3 5.1 track exist. Selecting the first audio track and converting it to AC3.\n'
console.log(`Neither a TrueHD track nor a desireable AC3 5.1 track exist. Selecting the first audio track and converting it to AC3.`)
response.infoLog += 'Neither a TrueHD track nor a desireable AC3 5.1 track exist. Selecting the first audio track and converting it to AC3.\n'
if (file.ffProbeData.streams[1].codec_type.toLowerCase() === 'audio') {
@ -486,7 +486,9 @@ const plugin = (file, librarySettings, inputs, otherArguments) => {
};
const processSubs = (file, librarySettings, inputs, otherArguments) => {
};
const processSubs = (file, librarySettings, inputs, otherArguments) => {
if (inputs.process_subs == false) {
@ -559,7 +561,9 @@ const plugin = (file, librarySettings, inputs, otherArguments) => {
};
const processVideo = (file, librarySettings, inputs, otherArguments) => {
};
const processVideo = (file, librarySettings, inputs, otherArguments) => {
if (inputs.process_video == false) {
@ -590,43 +594,45 @@ const plugin = (file, librarySettings, inputs, otherArguments) => {
};
// Start running functions
processAudio(file, librarySettings, inputs, otherArguments);
processSubs(file, librarySettings, inputs, otherArguments);
processVideo(file, librarySettings, inputs, otherArguments);
if (ffmpegAudioFirstTrack.length > 0 || ffmpegAudioOtherTracks.length > 0 || ffmpegSubs.length > 0 || ffmpegVideo.length > 0) {
response.infoLog += '☒ Changes are required! \n';
response.FFmpegMode = true;
response.container = `.${file.container}`;
response.preset = `,-c copy -map 0:v?${ffmpegVideo}${ffmpegAudioFirstTrack}${ffmpegAudioOtherTracks} -map 0:s?${ffmpegSubs} -map 0:d? -max_muxing_queue_size 9999`;
console.log(response.preset)
response.processFile = true;
return response;
}
if (ffmpegAudioFirstTrack.length == 0 && ffmpegAudioOtherTracks.length == 0 && ffmpegSubs.length == 0 && ffmpegVideo.length == 0) {
response.infoLog += '☑ No changes are required \n';
response.processFile = false;
return response;
}
};
// Start running functions
processAudio(file, librarySettings, inputs, otherArguments);
processSubs(file, librarySettings, inputs, otherArguments);
processVideo(file, librarySettings, inputs, otherArguments);
if (ffmpegAudioFirstTrack.length > 0 || ffmpegAudioOtherTracks.length > 0 || ffmpegSubs.length > 0 || ffmpegVideo.length > 0) {
response.infoLog += '☒ Changes are required! \n';
response.FFmpegMode = true;
response.container = `.${file.container}`;
response.preset = `,-c copy -map 0:v?${ffmpegVideo} -map 0:a?${ffmpegAudioFirstTrack}${ffmpegAudioOtherTracks} -map 0:s?${ffmpegSubs} -map 0:d? -max_muxing_queue_size 9999`;
console.log(response.preset)
response.processFile = true;
return response;
}
if (ffmpegAudioFirstTrack.length == 0 && ffmpegAudioOtherTracks.length == 0 && ffmpegSubs.length == 0 && ffmpegVideo.length == 0) {
response.infoLog += '☑ No changes are required \n';
response.processFile = false;
return response;
}
};
module.exports.details = details;
module.exports.plugin = plugin;