From f5778d88e832c3e61d0a91e5721484214e685c81 Mon Sep 17 00:00:00 2001 From: TheRealShadoh <49546181+TheRealShadoh@users.noreply.github.com> Date: Sat, 23 Nov 2019 20:16:42 -0600 Subject: [PATCH 1/8] Create Tdarr_Plugin_z0ab_TheRealShadoh_HandBrake_H264_Fast1080p30_EngSubs.js --- ...adoh_HandBrake_H264_Fast1080p30_EngSubs.js | 169 ++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 Community/Tdarr_Plugin_z0ab_TheRealShadoh_HandBrake_H264_Fast1080p30_EngSubs.js diff --git a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_HandBrake_H264_Fast1080p30_EngSubs.js b/Community/Tdarr_Plugin_z0ab_TheRealShadoh_HandBrake_H264_Fast1080p30_EngSubs.js new file mode 100644 index 0000000..4bed893 --- /dev/null +++ b/Community/Tdarr_Plugin_z0ab_TheRealShadoh_HandBrake_H264_Fast1080p30_EngSubs.js @@ -0,0 +1,169 @@ + + + +function details() { + + return { + id: "Tdarr_Plugin_z0ab_TheRealShadoh_HandBrake_H264_Fast1080p30_EngSubs.js", + Name: "TheRealShadoh HandBrake Fast1080p30, English subs, no title meta, 192Kb AAC stereo,MP4 ", + Type: "Video", + Description: `[Contains built-in filter] This plugin transcodes into H264 using HandBrake's 'Fast 1080p30' preset if the file is not in H264 already. It maintains English subtitles. It removes metadata (if a title exists) and adds a stereo 192kbit AAC track if an AAC track (any) doesn't exist. The output container is MP4. \n\n +`, + Version: "1.00", + Link: "https://github.com/TheRealShadoh/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_z0ab_TheRealShadoh_HandBrake_H264_Fast1080p30_EngSubs.js" + } + +} + +function plugin(file) { + + + //Must return this object + + var response = { + + processFile : false, + preset : '', + container : '.mp4', + handBrakeMode : false, + FFmpegMode : false, + reQueueAfter : false, + infoLog : '', + + } + + + + + + + + if (file.fileMedium !== "video") { + + + console.log("File is not video") + + response.infoLog += "☒File is not video \n" + response.processFile = false; + + return response + + } else { + + var jsonString = JSON.stringify(file) + + + var hasSubs = false + + + for (var i = 0; i < file.ffProbeData.streams.length; i++) { + + try { + + if(file.ffProbeData.streams[i].codec_type.toLowerCase() == "subtitle"){ + + hasSubs = true + + } + } catch (err) { } + } + + + if(file.ffProbeData.streams[0].codec_name != 'h264'){ + + response.infoLog += "☒File is not in h264! \n" + response.preset = '-Z "Fast 1080p30" --audio-lang-list eng,jpn --all-audio --subtitle-lang-list eng,und --all-subtitles' + response.reQueueAfter = true; + response.processFile = true; + response.handBrakeMode = true + return response + + }else{ + response.infoLog += "☑File is already in h264! \n" + } + + + /// + + if((file.meta.Title != "undefined") && !jsonString.includes("aac") && hasSubs){ + + response.infoLog += "☒File has title metadata and no aac and subs \n" + response.preset = ',-map_metadata -1 -map 0 -vcodec copy -acodec copy -scodec mov_text' + response.reQueueAfter = true; + response.processFile = true; + response.FFmpegMode = true + return response + } + + if(!jsonString.includes("aac") && hasSubs){ + + response.infoLog += "☒File has no aac track and has subs \n" + response.preset = ',-map 0:s:language:eng,language:en -map 0:v -map 0:a:language:eng,language:en,language:jpn,language:ja -map 0:a -map 0:s? -map 0:d? -vcodec copy -scodec mov_text -c:a:0 aac -b:a:0 192k -ac 2' + response.reQueueAfter = true; + response.processFile = true; + response.FFmpegMode = true + return response + } + + + if(file.meta.Title != "undefined" && hasSubs){ + + response.infoLog += "☒File has title and has subs \n" + response.preset = ',-map 0:s:language:eng,language:en -map_metadata -1 -map 0 -vcodec copy -acodec copy -scodec mov_text' + response.reQueueAfter = true; + response.processFile = true; + response.FFmpegMode = true + return response + } + + + + /// + if(file.meta.Title != undefined ){ + + response.infoLog += "☒File has title metadata \n" + response.preset = ',-map_metadata -1 -map 0 -vcodec copy -acodec copy -scodec mov_text' + response.reQueueAfter = true; + response.processFile = true; + response.FFmpegMode = true + return response + }else{ + response.infoLog += "☑File has no title metadata" + } + + if(!jsonString.includes("aac")){ + + response.infoLog += "☒File has no aac track \n" + response.preset = ',-map 0:v -map 0:a:0 -map 0:a:language:eng,language:en,language:jpn,language:ja -map 0:s? -map 0:d? -vcodec copy -scodec mov_text -c:a:0 aac -b:a:0 192k -ac 2' + response.reQueueAfter = true; + response.processFile = true; + response.FFmpegMode = true + return response + + }else{ + response.infoLog += "☑File has aac track \n" + } + + if(hasSubs){ + + response.infoLog += "☒File has subs \n" + response.preset = ',-map 0:s:language:eng,language:en -vcodec copy -acodec copy -scodec mov_text' + response.reQueueAfter = true; + response.processFile = true; + response.FFmpegMode = true + return response + + }else{ + response.infoLog += "☑File has no subs \n" + } + + + response.infoLog += "☑File meets conditions! \n" + return response + + } +} + +module.exports.details = details; + +module.exports.plugin = plugin; From bf3696959619dba17a70c81f6b397467e2fbcd78 Mon Sep 17 00:00:00 2001 From: Christian Crill Date: Sun, 24 Nov 2019 23:48:00 -0600 Subject: [PATCH 2/8] No longer aiming for keeping Eng subs... Initial upload --- ..._z0ab_TheRealShadoh_FFMPEG_H264_Medium.js} | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) rename Community/{Tdarr_Plugin_z0ab_TheRealShadoh_HandBrake_H264_Fast1080p30_EngSubs.js => Tdarr_Plugin_z0ab_TheRealShadoh_FFMPEG_H264_Medium.js} (66%) diff --git a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_HandBrake_H264_Fast1080p30_EngSubs.js b/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFMPEG_H264_Medium.js similarity index 66% rename from Community/Tdarr_Plugin_z0ab_TheRealShadoh_HandBrake_H264_Fast1080p30_EngSubs.js rename to Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFMPEG_H264_Medium.js index 4bed893..7c862b4 100644 --- a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_HandBrake_H264_Fast1080p30_EngSubs.js +++ b/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFMPEG_H264_Medium.js @@ -4,13 +4,13 @@ function details() { return { - id: "Tdarr_Plugin_z0ab_TheRealShadoh_HandBrake_H264_Fast1080p30_EngSubs.js", - Name: "TheRealShadoh HandBrake Fast1080p30, English subs, no title meta, 192Kb AAC stereo,MP4 ", + id: "Tdarr_Plugin_z0ab_TheRealShadoh_FFMPEG_H264_Medium.js", + Name: "TheRealShadoh FFMPEG Medium, video MP4, audio AAC, keep subs. ", Type: "Video", - Description: `[Contains built-in filter] This plugin transcodes into H264 using HandBrake's 'Fast 1080p30' preset if the file is not in H264 already. It maintains English subtitles. It removes metadata (if a title exists) and adds a stereo 192kbit AAC track if an AAC track (any) doesn't exist. The output container is MP4. \n\n + Description: `[Contains built-in filter] This plugin transcodes into H264 using FFMPEG's Medium' preset if the file is not in H264 already. It maintains all subtitles. It removes metadata (if a title exists), and maintains all audio tracks. The output container is MP4. Filter logic from "Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30". \n\n `, Version: "1.00", - Link: "https://github.com/TheRealShadoh/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_z0ab_TheRealShadoh_HandBrake_H264_Fast1080p30_EngSubs.js" + Link: "https://github.com/TheRealShadoh/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFMPEG_H264_Medium.js" } } @@ -33,7 +33,7 @@ function plugin(file) { } - + @@ -48,7 +48,7 @@ function plugin(file) { return response - } else { + } else { var jsonString = JSON.stringify(file) @@ -57,13 +57,13 @@ function plugin(file) { for (var i = 0; i < file.ffProbeData.streams.length; i++) { - + try { if(file.ffProbeData.streams[i].codec_type.toLowerCase() == "subtitle"){ - + hasSubs = true - + } } catch (err) { } } @@ -72,10 +72,10 @@ function plugin(file) { if(file.ffProbeData.streams[0].codec_name != 'h264'){ response.infoLog += "☒File is not in h264! \n" - response.preset = '-Z "Fast 1080p30" --audio-lang-list eng,jpn --all-audio --subtitle-lang-list eng,und --all-subtitles' + response.preset = ', -map_metadata -1 -map 0:v -map 0:s? -map 0:a -c:v libx264 -preset medium -c:a aac -c:s mov_text' response.reQueueAfter = true; response.processFile = true; - response.handBrakeMode = true + response.FFmpegMode = true return response }else{ @@ -88,7 +88,7 @@ function plugin(file) { if((file.meta.Title != "undefined") && !jsonString.includes("aac") && hasSubs){ response.infoLog += "☒File has title metadata and no aac and subs \n" - response.preset = ',-map_metadata -1 -map 0 -vcodec copy -acodec copy -scodec mov_text' + response.preset = ', -map_metadata -1 -map 0:v -map 0:s? -map 0:a -c:v copy -c:a aac -c:s mov_text' response.reQueueAfter = true; response.processFile = true; response.FFmpegMode = true @@ -98,7 +98,7 @@ function plugin(file) { if(!jsonString.includes("aac") && hasSubs){ response.infoLog += "☒File has no aac track and has subs \n" - response.preset = ',-map 0:s:language:eng,language:en -map 0:v -map 0:a:language:eng,language:en,language:jpn,language:ja -map 0:a -map 0:s? -map 0:d? -vcodec copy -scodec mov_text -c:a:0 aac -b:a:0 192k -ac 2' + response.preset = ', -map 0:v -map 0:s? -map 0:a -c:v copy -c:a aac -c:s mov_text' response.reQueueAfter = true; response.processFile = true; response.FFmpegMode = true @@ -109,7 +109,7 @@ function plugin(file) { if(file.meta.Title != "undefined" && hasSubs){ response.infoLog += "☒File has title and has subs \n" - response.preset = ',-map 0:s:language:eng,language:en -map_metadata -1 -map 0 -vcodec copy -acodec copy -scodec mov_text' + response.preset = ', -map_metadata -1 -map 0:v -map 0:s? -map 0:a -c:v copy -c:a copy -c:s mov_text' response.reQueueAfter = true; response.processFile = true; response.FFmpegMode = true @@ -122,7 +122,7 @@ function plugin(file) { if(file.meta.Title != undefined ){ response.infoLog += "☒File has title metadata \n" - response.preset = ',-map_metadata -1 -map 0 -vcodec copy -acodec copy -scodec mov_text' + response.preset = ', -map_metadata -1 -map 0:v -map 0:s? -map 0:a -c:v copy -c:a copy -c:s mov_text' response.reQueueAfter = true; response.processFile = true; response.FFmpegMode = true @@ -134,7 +134,7 @@ function plugin(file) { if(!jsonString.includes("aac")){ response.infoLog += "☒File has no aac track \n" - response.preset = ',-map 0:v -map 0:a:0 -map 0:a:language:eng,language:en,language:jpn,language:ja -map 0:s? -map 0:d? -vcodec copy -scodec mov_text -c:a:0 aac -b:a:0 192k -ac 2' + response.preset = ', -map 0:v -map 0:s? -map 0:a -c:v copy -c:a aac -c:s mov_text' response.reQueueAfter = true; response.processFile = true; response.FFmpegMode = true @@ -147,7 +147,7 @@ function plugin(file) { if(hasSubs){ response.infoLog += "☒File has subs \n" - response.preset = ',-map 0:s:language:eng,language:en -vcodec copy -acodec copy -scodec mov_text' + response.preset = ', -map 0:v -map 0:s? -map 0:a -c:v copy -c:a copy -c:s mov_text' response.reQueueAfter = true; response.processFile = true; response.FFmpegMode = true From ca27502031df61608ea06efd82f318b97ca6b3b3 Mon Sep 17 00:00:00 2001 From: Christian Crill Date: Mon, 25 Nov 2019 00:47:55 -0600 Subject: [PATCH 3/8] Updated details --- ...arr_Plugin_z0ab_TheRealShadoh_FFMPEG_H264_Medium.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFMPEG_H264_Medium.js b/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFMPEG_H264_Medium.js index 7c862b4..2892a7e 100644 --- a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFMPEG_H264_Medium.js +++ b/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFMPEG_H264_Medium.js @@ -7,7 +7,7 @@ function details() { id: "Tdarr_Plugin_z0ab_TheRealShadoh_FFMPEG_H264_Medium.js", Name: "TheRealShadoh FFMPEG Medium, video MP4, audio AAC, keep subs. ", Type: "Video", - Description: `[Contains built-in filter] This plugin transcodes into H264 using FFMPEG's Medium' preset if the file is not in H264 already. It maintains all subtitles. It removes metadata (if a title exists), and maintains all audio tracks. The output container is MP4. Filter logic from "Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30". \n\n + Description: `[Contains built-in filter] This plugin transcodes into H264 using FFMPEG's 'Medium' preset if the file is not in H264 already. It maintains all subtitles. It removes metadata (if a title exists), and maintains all audio tracks. The output container is MP4. \n\n `, Version: "1.00", Link: "https://github.com/TheRealShadoh/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFMPEG_H264_Medium.js" @@ -32,13 +32,7 @@ function plugin(file) { } - - - - - - - if (file.fileMedium !== "video") { + if (file.fileMedium !== "video"){ console.log("File is not video") From 606ca243b3b66156591799ce7ed7455c6916b677 Mon Sep 17 00:00:00 2001 From: Christian Crill Date: Mon, 25 Nov 2019 01:01:01 -0600 Subject: [PATCH 4/8] Created slow,fast,veryfast Updated names to reflect Subs being kept --- ...0ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js | 164 ++++++++++++++++++ ..._TheRealShadoh_FFmpeg_Subs_H264_Medium.js} | 8 +- ...0ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js | 163 +++++++++++++++++ ...TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js | 163 +++++++++++++++++ 4 files changed, 494 insertions(+), 4 deletions(-) create mode 100644 Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js rename Community/{Tdarr_Plugin_z0ab_TheRealShadoh_FFMPEG_H264_Medium.js => Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js} (93%) create mode 100644 Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js create mode 100644 Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js diff --git a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js b/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js new file mode 100644 index 0000000..2219c43 --- /dev/null +++ b/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js @@ -0,0 +1,164 @@ + + + +function details() { + + return { + id: "Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js", + Name: "TheRealShadoh FFmpeg Subs Fast, video MP4, audio AAC, keep subs. ", + Type: "Video", + Description: `[Contains built-in filter] This plugin transcodes into H264 using FFmpeg's 'Fast' preset if the file is not in H264 already. It maintains all subtitles. It removes metadata (if a title exists), and maintains all audio tracks. The output container is MP4. \n\n +`, + Version: "1.00", + Link: "https://github.com/TheRealShadoh/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js" + } + +} + +function plugin(file) { + + + //Must return this object + + var response = { + + processFile : false, + preset : '', + container : '.mp4', + handBrakeMode : false, + FFmpegMode : false, + FFmpegMode : false, + reQueueAfter : false, + infoLog : '', + + } + + if (file.fileMedium !== "video"){ + + + console.log("File is not video") + + response.infoLog += "☒File is not video \n" + response.processFile = false; + + return response + + } else { + + var jsonString = JSON.stringify(file) + + + var hasSubs = false + + + for (var i = 0; i < file.ffProbeData.streams.length; i++) { + + try { + + if(file.ffProbeData.streams[i].codec_type.toLowerCase() == "subtitle"){ + + hasSubs = true + + } + } catch (err) { } + } + + + if(file.ffProbeData.streams[0].codec_name != 'h264'){ + + response.infoLog += "☒File is not in h264! \n" + response.preset = ', -map_metadata -1 -map 0:v -map 0:s? -map 0:a -c:v libx264 -preset fast -c:a aac -c:s mov_text' + response.reQueueAfter = true; + response.processFile = true; + response.FFmpegMode = true + return response + + }else{ + response.infoLog += "☑File is already in h264! \n" + } + + + /// + + if((file.meta.Title != "undefined") && !jsonString.includes("aac") && hasSubs){ + + response.infoLog += "☒File has title metadata and no aac and subs \n" + response.preset = ', -map_metadata -1 -map 0:v -map 0:s? -map 0:a -c:v copy -c:a aac -c:s mov_text' + response.reQueueAfter = true; + response.processFile = true; + response.FFmpegMode = true + return response + } + + if(!jsonString.includes("aac") && hasSubs){ + + response.infoLog += "☒File has no aac track and has subs \n" + response.preset = ', -map 0:v -map 0:s? -map 0:a -c:v copy -c:a aac -c:s mov_text' + response.reQueueAfter = true; + response.processFile = true; + response.FFmpegMode = true + return response + } + + + if(file.meta.Title != "undefined" && hasSubs){ + + response.infoLog += "☒File has title and has subs \n" + response.preset = ', -map_metadata -1 -map 0:v -map 0:s? -map 0:a -c:v copy -c:a copy -c:s mov_text' + response.reQueueAfter = true; + response.processFile = true; + response.FFmpegMode = true + return response + } + + + + /// + if(file.meta.Title != undefined ){ + + response.infoLog += "☒File has title metadata \n" + response.preset = ', -map_metadata -1 -map 0:v -map 0:s? -map 0:a -c:v copy -c:a copy -c:s mov_text' + response.reQueueAfter = true; + response.processFile = true; + response.FFmpegMode = true + return response + }else{ + response.infoLog += "☑File has no title metadata" + } + + if(!jsonString.includes("aac")){ + + response.infoLog += "☒File has no aac track \n" + response.preset = ', -map 0:v -map 0:s? -map 0:a -c:v copy -c:a aac -c:s mov_text' + response.reQueueAfter = true; + response.processFile = true; + response.FFmpegMode = true + return response + + }else{ + response.infoLog += "☑File has aac track \n" + } + + if(hasSubs){ + + response.infoLog += "☒File has subs \n" + response.preset = ', -map 0:v -map 0:s? -map 0:a -c:v copy -c:a copy -c:s mov_text' + response.reQueueAfter = true; + response.processFile = true; + response.FFmpegMode = true + return response + + }else{ + response.infoLog += "☑File has no subs \n" + } + + + response.infoLog += "☑File meets conditions! \n" + return response + + } +} + +module.exports.details = details; + +module.exports.plugin = plugin; diff --git a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFMPEG_H264_Medium.js b/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js similarity index 93% rename from Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFMPEG_H264_Medium.js rename to Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js index 2892a7e..5434681 100644 --- a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFMPEG_H264_Medium.js +++ b/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js @@ -4,13 +4,13 @@ function details() { return { - id: "Tdarr_Plugin_z0ab_TheRealShadoh_FFMPEG_H264_Medium.js", - Name: "TheRealShadoh FFMPEG Medium, video MP4, audio AAC, keep subs. ", + id: "Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js", + Name: "TheRealShadoh FFmpeg Subs Medium, video MP4, audio AAC, keep subs. ", Type: "Video", - Description: `[Contains built-in filter] This plugin transcodes into H264 using FFMPEG's 'Medium' preset if the file is not in H264 already. It maintains all subtitles. It removes metadata (if a title exists), and maintains all audio tracks. The output container is MP4. \n\n + Description: `[Contains built-in filter] This plugin transcodes into H264 using FFmpeg's 'Medium' preset if the file is not in H264 already. It maintains all subtitles. It removes metadata (if a title exists), and maintains all audio tracks. The output container is MP4. \n\n `, Version: "1.00", - Link: "https://github.com/TheRealShadoh/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFMPEG_H264_Medium.js" + Link: "https://github.com/TheRealShadoh/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js" } } diff --git a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js b/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js new file mode 100644 index 0000000..66f71ba --- /dev/null +++ b/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js @@ -0,0 +1,163 @@ + + + +function details() { + + return { + id: "Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js", + Name: "TheRealShadoh FFmpeg Subs Slow, video MP4, audio AAC, keep subs. ", + Type: "Video", + Description: `[Contains built-in filter] This plugin transcodes into H264 using FFmpeg's 'Slow' preset if the file is not in H264 already. It maintains all subtitles. It removes metadata (if a title exists), and maintains all audio tracks. The output container is MP4. \n\n +`, + Version: "1.00", + Link: "https://github.com/TheRealShadoh/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js" + } + +} + +function plugin(file) { + + + //Must return this object + + var response = { + + processFile : false, + preset : '', + container : '.mp4', + handBrakeMode : false, + FFmpegMode : false, + reQueueAfter : false, + infoLog : '', + + } + + if (file.fileMedium !== "video"){ + + + console.log("File is not video") + + response.infoLog += "☒File is not video \n" + response.processFile = false; + + return response + + } else { + + var jsonString = JSON.stringify(file) + + + var hasSubs = false + + + for (var i = 0; i < file.ffProbeData.streams.length; i++) { + + try { + + if(file.ffProbeData.streams[i].codec_type.toLowerCase() == "subtitle"){ + + hasSubs = true + + } + } catch (err) { } + } + + + if(file.ffProbeData.streams[0].codec_name != 'h264'){ + + response.infoLog += "☒File is not in h264! \n" + response.preset = ', -map_metadata -1 -map 0:v -map 0:s? -map 0:a -c:v libx264 -preset slow -c:a aac -c:s mov_text' + response.reQueueAfter = true; + response.processFile = true; + response.FFmpegMode = true + return response + + }else{ + response.infoLog += "☑File is already in h264! \n" + } + + + /// + + if((file.meta.Title != "undefined") && !jsonString.includes("aac") && hasSubs){ + + response.infoLog += "☒File has title metadata and no aac and subs \n" + response.preset = ', -map_metadata -1 -map 0:v -map 0:s? -map 0:a -c:v copy -c:a aac -c:s mov_text' + response.reQueueAfter = true; + response.processFile = true; + response.FFmpegMode = true + return response + } + + if(!jsonString.includes("aac") && hasSubs){ + + response.infoLog += "☒File has no aac track and has subs \n" + response.preset = ', -map 0:v -map 0:s? -map 0:a -c:v copy -c:a aac -c:s mov_text' + response.reQueueAfter = true; + response.processFile = true; + response.FFmpegMode = true + return response + } + + + if(file.meta.Title != "undefined" && hasSubs){ + + response.infoLog += "☒File has title and has subs \n" + response.preset = ', -map_metadata -1 -map 0:v -map 0:s? -map 0:a -c:v copy -c:a copy -c:s mov_text' + response.reQueueAfter = true; + response.processFile = true; + response.FFmpegMode = true + return response + } + + + + /// + if(file.meta.Title != undefined ){ + + response.infoLog += "☒File has title metadata \n" + response.preset = ', -map_metadata -1 -map 0:v -map 0:s? -map 0:a -c:v copy -c:a copy -c:s mov_text' + response.reQueueAfter = true; + response.processFile = true; + response.FFmpegMode = true + return response + }else{ + response.infoLog += "☑File has no title metadata" + } + + if(!jsonString.includes("aac")){ + + response.infoLog += "☒File has no aac track \n" + response.preset = ', -map 0:v -map 0:s? -map 0:a -c:v copy -c:a aac -c:s mov_text' + response.reQueueAfter = true; + response.processFile = true; + response.FFmpegMode = true + return response + + }else{ + response.infoLog += "☑File has aac track \n" + } + + if(hasSubs){ + + response.infoLog += "☒File has subs \n" + response.preset = ', -map 0:v -map 0:s? -map 0:a -c:v copy -c:a copy -c:s mov_text' + response.reQueueAfter = true; + response.processFile = true; + response.FFmpegMode = true + return response + + }else{ + response.infoLog += "☑File has no subs \n" + } + + + response.infoLog += "☑File meets conditions! \n" + return response + + } +} + +module.exports.details = details; + +module.exports.plugin = plugin; diff --git a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js b/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js new file mode 100644 index 0000000..6bbd312 --- /dev/null +++ b/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js @@ -0,0 +1,163 @@ + + + +function details() { + + return { + id: "Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js", + Name: "TheRealShadoh FFmpeg Subs VeryFast, video MP4, audio AAC, keep subs. ", + Type: "Video", + Description: `[Contains built-in filter] This plugin transcodes into H264 using FFmpeg's 'VeryFast' preset if the file is not in H264 already. It maintains all subtitles. It removes metadata (if a title exists), and maintains all audio tracks. The output container is MP4. \n\n +`, + Version: "1.00", + Link: "https://github.com/TheRealShadoh/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Veryfast.js" + } + +} + +function plugin(file) { + + + //Must return this object + + var response = { + + processFile : false, + preset : '', + container : '.mp4', + handBrakeMode : false, + FFmpegMode : false, + reQueueAfter : false, + infoLog : '', + + } + + if (file.fileMedium !== "video"){ + + + console.log("File is not video") + + response.infoLog += "☒File is not video \n" + response.processFile = false; + + return response + + } else { + + var jsonString = JSON.stringify(file) + + + var hasSubs = false + + + for (var i = 0; i < file.ffProbeData.streams.length; i++) { + + try { + + if(file.ffProbeData.streams[i].codec_type.toLowerCase() == "subtitle"){ + + hasSubs = true + + } + } catch (err) { } + } + + + if(file.ffProbeData.streams[0].codec_name != 'h264'){ + + response.infoLog += "☒File is not in h264! \n" + response.preset = ', -map_metadata -1 -map 0:v -map 0:s? -map 0:a -c:v libx264 -preset veryfast -c:a aac -c:s mov_text' + response.reQueueAfter = true; + response.processFile = true; + response.FFmpegMode = true + return response + + }else{ + response.infoLog += "☑File is already in h264! \n" + } + + + /// + + if((file.meta.Title != "undefined") && !jsonString.includes("aac") && hasSubs){ + + response.infoLog += "☒File has title metadata and no aac and subs \n" + response.preset = ', -map_metadata -1 -map 0:v -map 0:s? -map 0:a -c:v copy -c:a aac -c:s mov_text' + response.reQueueAfter = true; + response.processFile = true; + response.FFmpegMode = true + return response + } + + if(!jsonString.includes("aac") && hasSubs){ + + response.infoLog += "☒File has no aac track and has subs \n" + response.preset = ', -map 0:v -map 0:s? -map 0:a -c:v copy -c:a aac -c:s mov_text' + response.reQueueAfter = true; + response.processFile = true; + response.FFmpegMode = true + return response + } + + + if(file.meta.Title != "undefined" && hasSubs){ + + response.infoLog += "☒File has title and has subs \n" + response.preset = ', -map_metadata -1 -map 0:v -map 0:s? -map 0:a -c:v copy -c:a copy -c:s mov_text' + response.reQueueAfter = true; + response.processFile = true; + response.FFmpegMode = true + return response + } + + + + /// + if(file.meta.Title != undefined ){ + + response.infoLog += "☒File has title metadata \n" + response.preset = ', -map_metadata -1 -map 0:v -map 0:s? -map 0:a -c:v copy -c:a copy -c:s mov_text' + response.reQueueAfter = true; + response.processFile = true; + response.FFmpegMode = true + return response + }else{ + response.infoLog += "☑File has no title metadata" + } + + if(!jsonString.includes("aac")){ + + response.infoLog += "☒File has no aac track \n" + response.preset = ', -map 0:v -map 0:s? -map 0:a -c:v copy -c:a aac -c:s mov_text' + response.reQueueAfter = true; + response.processFile = true; + response.FFmpegMode = true + return response + + }else{ + response.infoLog += "☑File has aac track \n" + } + + if(hasSubs){ + + response.infoLog += "☒File has subs \n" + response.preset = ', -map 0:v -map 0:s? -map 0:a -c:v copy -c:a copy -c:s mov_text' + response.reQueueAfter = true; + response.processFile = true; + response.FFmpegMode = true + return response + + }else{ + response.infoLog += "☑File has no subs \n" + } + + + response.infoLog += "☑File meets conditions! \n" + return response + + } +} + +module.exports.details = details; + +module.exports.plugin = plugin; From 528cac935a5f841ab9a2bb92952e3f203fdc457d Mon Sep 17 00:00:00 2001 From: Christian Crill Date: Mon, 25 Nov 2019 01:20:31 -0600 Subject: [PATCH 5/8] Names --- ...0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js | 2 +- ...z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js} | 17 ++++++++--------- ...z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js} | 16 ++++++++-------- ..._TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js} | 16 ++++++++-------- 4 files changed, 25 insertions(+), 26 deletions(-) rename Community/{Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js => Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js} (95%) rename Community/{Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js => Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js} (95%) rename Community/{Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js => Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js} (95%) diff --git a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js b/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js index 5434681..60cf4dd 100644 --- a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js +++ b/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js @@ -151,7 +151,7 @@ function plugin(file) { response.infoLog += "☑File has no subs \n" } - + response.processFile = false; response.infoLog += "☑File meets conditions! \n" return response diff --git a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js b/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js similarity index 95% rename from Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js rename to Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js index 2219c43..98f3490 100644 --- a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js +++ b/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js @@ -22,14 +22,13 @@ function plugin(file) { var response = { - processFile : false, - preset : '', - container : '.mp4', - handBrakeMode : false, - FFmpegMode : false, - FFmpegMode : false, - reQueueAfter : false, - infoLog : '', + processFile : false, + preset : '', + container : '.mp4', + handBrakeMode : false, + FFmpegMode : false, + reQueueAfter : false, + infoLog : '', } @@ -152,7 +151,7 @@ function plugin(file) { response.infoLog += "☑File has no subs \n" } - + response.processFile = false; response.infoLog += "☑File meets conditions! \n" return response diff --git a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js b/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js similarity index 95% rename from Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js rename to Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js index 66f71ba..1e48b1c 100644 --- a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js +++ b/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js @@ -22,13 +22,13 @@ function plugin(file) { var response = { - processFile : false, - preset : '', - container : '.mp4', - handBrakeMode : false, - FFmpegMode : false, - reQueueAfter : false, - infoLog : '', + processFile : false, + preset : '', + container : '.mp4', + handBrakeMode : false, + FFmpegMode : false, + reQueueAfter : false, + infoLog : '', } @@ -151,7 +151,7 @@ function plugin(file) { response.infoLog += "☑File has no subs \n" } - + response.processFile = false; response.infoLog += "☑File meets conditions! \n" return response diff --git a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js b/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js similarity index 95% rename from Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js rename to Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js index 6bbd312..9ab94d0 100644 --- a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js +++ b/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js @@ -22,13 +22,13 @@ function plugin(file) { var response = { - processFile : false, - preset : '', - container : '.mp4', - handBrakeMode : false, - FFmpegMode : false, - reQueueAfter : false, - infoLog : '', + processFile : false, + preset : '', + container : '.mp4', + handBrakeMode : false, + FFmpegMode : false, + reQueueAfter : false, + infoLog : '', } @@ -151,7 +151,7 @@ function plugin(file) { response.infoLog += "☑File has no subs \n" } - + response.processFile = false; response.infoLog += "☑File meets conditions! \n" return response From b21f1f4fc4636ea3d64bad2d39d3dff235eb54ba Mon Sep 17 00:00:00 2001 From: Christian Crill Date: Mon, 25 Nov 2019 01:24:18 -0600 Subject: [PATCH 6/8] Names --- .../Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js | 4 ++-- .../Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js | 4 ++-- ...arr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js b/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js index 98f3490..39460b4 100644 --- a/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js +++ b/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js @@ -4,13 +4,13 @@ function details() { return { - id: "Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js", + id: "Tdarr_Plugin_z1sab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js", Name: "TheRealShadoh FFmpeg Subs Fast, video MP4, audio AAC, keep subs. ", Type: "Video", Description: `[Contains built-in filter] This plugin transcodes into H264 using FFmpeg's 'Fast' preset if the file is not in H264 already. It maintains all subtitles. It removes metadata (if a title exists), and maintains all audio tracks. The output container is MP4. \n\n `, Version: "1.00", - Link: "https://github.com/TheRealShadoh/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js" + Link: "https://github.com/TheRealShadoh/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js" } } diff --git a/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js b/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js index 1e48b1c..e9e9994 100644 --- a/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js +++ b/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js @@ -4,13 +4,13 @@ function details() { return { - id: "Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js", + id: "Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js", Name: "TheRealShadoh FFmpeg Subs Slow, video MP4, audio AAC, keep subs. ", Type: "Video", Description: `[Contains built-in filter] This plugin transcodes into H264 using FFmpeg's 'Slow' preset if the file is not in H264 already. It maintains all subtitles. It removes metadata (if a title exists), and maintains all audio tracks. The output container is MP4. \n\n `, Version: "1.00", - Link: "https://github.com/TheRealShadoh/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js" + Link: "https://github.com/TheRealShadoh/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js" } } diff --git a/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js b/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js index 9ab94d0..6ffc456 100644 --- a/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js +++ b/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js @@ -4,13 +4,13 @@ function details() { return { - id: "Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js", + id: "Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js", Name: "TheRealShadoh FFmpeg Subs VeryFast, video MP4, audio AAC, keep subs. ", Type: "Video", Description: `[Contains built-in filter] This plugin transcodes into H264 using FFmpeg's 'VeryFast' preset if the file is not in H264 already. It maintains all subtitles. It removes metadata (if a title exists), and maintains all audio tracks. The output container is MP4. \n\n `, Version: "1.00", - Link: "https://github.com/TheRealShadoh/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Veryfast.js" + Link: "https://github.com/TheRealShadoh/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_Veryfast.js" } } From 2dd8b95828dedf93cf36873f5e41258ac12fe18b Mon Sep 17 00:00:00 2001 From: Christian Crill Date: Mon, 25 Nov 2019 01:31:06 -0600 Subject: [PATCH 7/8] Names --- .../Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js b/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js index 39460b4..1c02c03 100644 --- a/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js +++ b/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js @@ -4,7 +4,7 @@ function details() { return { - id: "Tdarr_Plugin_z1sab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js", + id: "Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js", Name: "TheRealShadoh FFmpeg Subs Fast, video MP4, audio AAC, keep subs. ", Type: "Video", Description: `[Contains built-in filter] This plugin transcodes into H264 using FFmpeg's 'Fast' preset if the file is not in H264 already. It maintains all subtitles. It removes metadata (if a title exists), and maintains all audio tracks. The output container is MP4. \n\n From 629a886312a173cf830f4813456735fc5853d294 Mon Sep 17 00:00:00 2001 From: Christian Crill Date: Mon, 25 Nov 2019 02:20:51 -0600 Subject: [PATCH 8/8] Remvoed "" from undefined in logic --- ...arr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js | 5 ++--- ...Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js | 6 ++---- ...Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js | 5 ++--- ...r_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js | 5 ++--- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js b/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js index 60cf4dd..85ab199 100644 --- a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js +++ b/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js @@ -79,7 +79,7 @@ function plugin(file) { /// - if((file.meta.Title != "undefined") && !jsonString.includes("aac") && hasSubs){ + if((file.meta.Title != undefined) && !jsonString.includes("aac") && hasSubs){ response.infoLog += "☒File has title metadata and no aac and subs \n" response.preset = ', -map_metadata -1 -map 0:v -map 0:s? -map 0:a -c:v copy -c:a aac -c:s mov_text' @@ -100,7 +100,7 @@ function plugin(file) { } - if(file.meta.Title != "undefined" && hasSubs){ + if(file.meta.Title != undefined && hasSubs){ response.infoLog += "☒File has title and has subs \n" response.preset = ', -map_metadata -1 -map 0:v -map 0:s? -map 0:a -c:v copy -c:a copy -c:s mov_text' @@ -151,7 +151,6 @@ function plugin(file) { response.infoLog += "☑File has no subs \n" } - response.processFile = false; response.infoLog += "☑File meets conditions! \n" return response diff --git a/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js b/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js index 1c02c03..a5bbdc0 100644 --- a/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js +++ b/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js @@ -79,7 +79,7 @@ function plugin(file) { /// - if((file.meta.Title != "undefined") && !jsonString.includes("aac") && hasSubs){ + if((file.meta.Title != undefined) && !jsonString.includes("aac") && hasSubs){ response.infoLog += "☒File has title metadata and no aac and subs \n" response.preset = ', -map_metadata -1 -map 0:v -map 0:s? -map 0:a -c:v copy -c:a aac -c:s mov_text' @@ -100,7 +100,7 @@ function plugin(file) { } - if(file.meta.Title != "undefined" && hasSubs){ + if(file.meta.Title != undefined && hasSubs){ response.infoLog += "☒File has title and has subs \n" response.preset = ', -map_metadata -1 -map 0:v -map 0:s? -map 0:a -c:v copy -c:a copy -c:s mov_text' @@ -111,7 +111,6 @@ function plugin(file) { } - /// if(file.meta.Title != undefined ){ @@ -151,7 +150,6 @@ function plugin(file) { response.infoLog += "☑File has no subs \n" } - response.processFile = false; response.infoLog += "☑File meets conditions! \n" return response diff --git a/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js b/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js index e9e9994..f7f39ed 100644 --- a/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js +++ b/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js @@ -79,7 +79,7 @@ function plugin(file) { /// - if((file.meta.Title != "undefined") && !jsonString.includes("aac") && hasSubs){ + if((file.meta.Title != undefined) && !jsonString.includes("aac") && hasSubs){ response.infoLog += "☒File has title metadata and no aac and subs \n" response.preset = ', -map_metadata -1 -map 0:v -map 0:s? -map 0:a -c:v copy -c:a aac -c:s mov_text' @@ -100,7 +100,7 @@ function plugin(file) { } - if(file.meta.Title != "undefined" && hasSubs){ + if(file.meta.Title != undefined && hasSubs){ response.infoLog += "☒File has title and has subs \n" response.preset = ', -map_metadata -1 -map 0:v -map 0:s? -map 0:a -c:v copy -c:a copy -c:s mov_text' @@ -151,7 +151,6 @@ function plugin(file) { response.infoLog += "☑File has no subs \n" } - response.processFile = false; response.infoLog += "☑File meets conditions! \n" return response diff --git a/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js b/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js index 6ffc456..2211f6c 100644 --- a/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js +++ b/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js @@ -79,7 +79,7 @@ function plugin(file) { /// - if((file.meta.Title != "undefined") && !jsonString.includes("aac") && hasSubs){ + if((file.meta.Title != undefined) && !jsonString.includes("aac") && hasSubs){ response.infoLog += "☒File has title metadata and no aac and subs \n" response.preset = ', -map_metadata -1 -map 0:v -map 0:s? -map 0:a -c:v copy -c:a aac -c:s mov_text' @@ -100,7 +100,7 @@ function plugin(file) { } - if(file.meta.Title != "undefined" && hasSubs){ + if(file.meta.Title != undefined && hasSubs){ response.infoLog += "☒File has title and has subs \n" response.preset = ', -map_metadata -1 -map 0:v -map 0:s? -map 0:a -c:v copy -c:a copy -c:s mov_text' @@ -151,7 +151,6 @@ function plugin(file) { response.infoLog += "☑File has no subs \n" } - response.processFile = false; response.infoLog += "☑File meets conditions! \n" return response