From e7c224f335d22d8a87ebe8e658701e81667ee44f Mon Sep 17 00:00:00 2001
From: MrMeeb <charles.macdonald@me.com>
Date: Sun, 28 Apr 2024 09:38:13 +0000
Subject: [PATCH] Fix error in DTS detection where profile is not set

---
 Tdarr_Plugin_MM1_MrMeeb_Extract_Subs.js | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/Tdarr_Plugin_MM1_MrMeeb_Extract_Subs.js b/Tdarr_Plugin_MM1_MrMeeb_Extract_Subs.js
index f4262d7..1822fb9 100644
--- a/Tdarr_Plugin_MM1_MrMeeb_Extract_Subs.js
+++ b/Tdarr_Plugin_MM1_MrMeeb_Extract_Subs.js
@@ -4,10 +4,24 @@ const details = () => ({
     Name: 'MrMeeb Extract Subtitles',
     Type: 'Subtitle',
     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',
     Tags: 'pre-processing',
-    Inputs: [],
+    Inputs: [
+      {
+        name: 'forced_only',
+        type: 'boolean',         
+        defaultValue: false,  
+        inputUI: {
+          type: 'dropdown',
+          options: [
+            'true',
+            'false',
+          ],
+        },
+        tooltip: `Only extract forced subtitles`,
+      },
+    ],
   });
   
   // eslint-disable-next-line no-unused-vars
@@ -56,6 +70,7 @@ const details = () => ({
     let subIdx = -1; // The stream index of the current subtitle stream, relative to all subtitle steams
 
     console.log(` === Running Extract Subs function === `)
+    response.jobLog += `Hello!`
 
     // Identify all subtitles
     for (let i = 0; i < file.ffProbeData.streams.length; i ++) {