Compare commits

..

6 Commits

Author SHA1 Message Date
9fa79a752b Fix error in DTS detection where profile is not set 2024-04-28 17:00:07 +00:00
4c24372e48 Remove config option accidentally committed 2024-04-28 09:39:00 +00:00
e7c224f335 Fix error in DTS detection where profile is not set 2024-04-28 09:38:13 +00:00
c6292e14dd Fix missing quote 2024-04-27 21:31:57 +00:00
9c60d80bbd Ensure only DTS-HD MA is picked up
Using 'codec_name' would otherwise select anything with DTS, regardless if lossless or lossy
2024-04-27 21:28:16 +00:00
45da0baf90 Only remove SRTs with matching filename 2024-04-27 21:21:22 +00:00
2 changed files with 6 additions and 3 deletions

View File

@ -4,7 +4,7 @@ const details = () => ({
Name: 'MrMeeb Extract Subtitles', Name: 'MrMeeb Extract Subtitles',
Type: 'Subtitle', Type: 'Subtitle',
Operation: 'Transcode', Operation: 'Transcode',
Description: 'Automatically extracts SRT subtitles to external files and removes the embedded ones.', Description: 'Automatically extracts SRT subtitles to external files and removes the embedded ones. Created to fix a bug where Infuse cannot auto-select embedded forced subtitles',
Version: '0.1', Version: '0.1',
Tags: 'pre-processing', Tags: 'pre-processing',
Inputs: [], Inputs: [],
@ -56,6 +56,7 @@ const details = () => ({
let subIdx = -1; // The stream index of the current subtitle stream, relative to all subtitle steams let subIdx = -1; // The stream index of the current subtitle stream, relative to all subtitle steams
console.log(` === Running Extract Subs function === `) console.log(` === Running Extract Subs function === `)
response.jobLog += `Hello!`
// Identify all subtitles // Identify all subtitles
for (let i = 0; i < file.ffProbeData.streams.length; i ++) { for (let i = 0; i < file.ffProbeData.streams.length; i ++) {
@ -153,9 +154,11 @@ const details = () => ({
if (ffmpegSubs.length > 0) { if (ffmpegSubs.length > 0) {
let subName = removeMKV(otherArguments.originalLibraryFile.meta.FileName)
response.infoLog += '☒ Changes are required! \n Extracting SRT files'; response.infoLog += '☒ Changes are required! \n Extracting SRT files';
require("child_process").execSync(`rm -rf ${otherArguments.originalLibraryFile.meta.Directory}/*.srt`) require("child_process").execSync(`rm -rf "${otherArguments.originalLibraryFile.meta.Directory}/${subName}"*.srt`)
response.FFmpegMode = true; response.FFmpegMode = true;

View File

@ -291,7 +291,7 @@ const response = {
} }
// Identify if stream is DTS-HD MA // Identify if stream is DTS-HD MA
if (file.ffProbeData.streams[i].codec_name.toLowerCase() === 'dts') { if (file.ffProbeData.streams[i].profile != undefined && file.ffProbeData.streams[i].profile.toLowerCase() === 'dts-hd ma') {
// Check if DTS-HD MA has already been handled by a previous run // Check if DTS-HD MA has already been handled by a previous run
// Assume that it will be the second stream (first audio stream) - it should be, if already handled // Assume that it will be the second stream (first audio stream) - it should be, if already handled