mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-09 23:48:15 -07:00
commit
3671676602
6 changed files with 34 additions and 5 deletions
|
|
@ -6,6 +6,7 @@ const details = () => ({
|
|||
Operation: 'Transcode',
|
||||
Description: `
|
||||
This plugin removes streams based on the specified property.
|
||||
Checks FFprobe 'streams' and MediaInfo 'track' properties.
|
||||
`,
|
||||
Version: '1.00',
|
||||
Tags: 'action',
|
||||
|
|
@ -76,7 +77,10 @@ const plugin = (file, librarySettings, inputs, otherArguments) => {
|
|||
let streamToRemove = false;
|
||||
for (let i = 0; i < file.ffProbeData.streams.length; i += 1) {
|
||||
try {
|
||||
if (valuesToRemove.includes(String(file.ffProbeData.streams[i][propertyToCheck]))) {
|
||||
if (
|
||||
valuesToRemove.includes(String(file.ffProbeData.streams[i][propertyToCheck]))
|
||||
|| valuesToRemove.includes(String(file.mediaInfo.track[i + 1][propertyToCheck]))
|
||||
) {
|
||||
response.preset += ` -map -0:${i} `;
|
||||
response.infoLog += ` Removing stream ${i} which is has ${propertyToCheck}`
|
||||
+ ` of ${file.ffProbeData.streams[i][propertyToCheck]} \n`;
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ var details = function () { return ({
|
|||
inputUI: {
|
||||
type: 'switch',
|
||||
},
|
||||
tooltip: 'Specify whether to copy/move all files in the directory (excluding the original and working file)',
|
||||
tooltip: "Specify whether to copy/move all files in the directory (excluding the original and working file)\n or use the input below to specify file extensions",
|
||||
},
|
||||
{
|
||||
label: 'File Extensions',
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ var details = function () { return ({
|
|||
label: 'Variable',
|
||||
name: 'variable',
|
||||
type: 'string',
|
||||
defaultValue: '{{{args.librarySettings._id}}}',
|
||||
defaultValue: '',
|
||||
inputUI: {
|
||||
type: 'text',
|
||||
},
|
||||
|
|
|
|||
|
|
@ -82,7 +82,8 @@ Useful if, for example, you want to move things like subtitle files or cover art
|
|||
inputUI: {
|
||||
type: 'switch',
|
||||
},
|
||||
tooltip: 'Specify whether to copy/move all files in the directory (excluding the original and working file)',
|
||||
tooltip: `Specify whether to copy/move all files in the directory (excluding the original and working file)
|
||||
or use the input below to specify file extensions`,
|
||||
},
|
||||
{
|
||||
label: 'File Extensions',
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ const details = (): IpluginDetails => ({
|
|||
label: 'Variable',
|
||||
name: 'variable',
|
||||
type: 'string',
|
||||
defaultValue: '{{{args.librarySettings._id}}}',
|
||||
defaultValue: '',
|
||||
inputUI: {
|
||||
type: 'text',
|
||||
},
|
||||
|
|
|
|||
|
|
@ -217,6 +217,30 @@ const tests = [
|
|||
+ ' Files has streams which need to be removed, processing \n',
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
input: {
|
||||
file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')),
|
||||
librarySettings: {},
|
||||
inputs: {
|
||||
propertyToCheck: 'CodecID',
|
||||
valuesToRemove: 'A_AAC-2,S_TEXT/UTF8',
|
||||
},
|
||||
otherArguments: {},
|
||||
},
|
||||
output: {
|
||||
processFile: true,
|
||||
preset: ', -map 0 -c copy -max_muxing_queue_size 9999 -map -0:4 -map -0:5 -map -0:6 ',
|
||||
container: '.mkv',
|
||||
handBrakeMode: false,
|
||||
FFmpegMode: true,
|
||||
reQueueAfter: false,
|
||||
infoLog: ' Removing stream 4 which is has CodecID of undefined \n'
|
||||
+ ' Removing stream 5 which is has CodecID of undefined \n'
|
||||
+ ' Removing stream 6 which is has CodecID of undefined \n'
|
||||
+ ' Files has streams which need to be removed, processing \n',
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
void run(tests);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue