mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-14 17:55:55 -07:00
commit
3671676602
6 changed files with 34 additions and 5 deletions
|
|
@ -6,6 +6,7 @@ const details = () => ({
|
||||||
Operation: 'Transcode',
|
Operation: 'Transcode',
|
||||||
Description: `
|
Description: `
|
||||||
This plugin removes streams based on the specified property.
|
This plugin removes streams based on the specified property.
|
||||||
|
Checks FFprobe 'streams' and MediaInfo 'track' properties.
|
||||||
`,
|
`,
|
||||||
Version: '1.00',
|
Version: '1.00',
|
||||||
Tags: 'action',
|
Tags: 'action',
|
||||||
|
|
@ -76,7 +77,10 @@ const plugin = (file, librarySettings, inputs, otherArguments) => {
|
||||||
let streamToRemove = false;
|
let streamToRemove = false;
|
||||||
for (let i = 0; i < file.ffProbeData.streams.length; i += 1) {
|
for (let i = 0; i < file.ffProbeData.streams.length; i += 1) {
|
||||||
try {
|
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.preset += ` -map -0:${i} `;
|
||||||
response.infoLog += ` Removing stream ${i} which is has ${propertyToCheck}`
|
response.infoLog += ` Removing stream ${i} which is has ${propertyToCheck}`
|
||||||
+ ` of ${file.ffProbeData.streams[i][propertyToCheck]} \n`;
|
+ ` of ${file.ffProbeData.streams[i][propertyToCheck]} \n`;
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ var details = function () { return ({
|
||||||
inputUI: {
|
inputUI: {
|
||||||
type: 'switch',
|
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',
|
label: 'File Extensions',
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ var details = function () { return ({
|
||||||
label: 'Variable',
|
label: 'Variable',
|
||||||
name: 'variable',
|
name: 'variable',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
defaultValue: '{{{args.librarySettings._id}}}',
|
defaultValue: '',
|
||||||
inputUI: {
|
inputUI: {
|
||||||
type: 'text',
|
type: 'text',
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,8 @@ Useful if, for example, you want to move things like subtitle files or cover art
|
||||||
inputUI: {
|
inputUI: {
|
||||||
type: 'switch',
|
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',
|
label: 'File Extensions',
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ const details = (): IpluginDetails => ({
|
||||||
label: 'Variable',
|
label: 'Variable',
|
||||||
name: 'variable',
|
name: 'variable',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
defaultValue: '{{{args.librarySettings._id}}}',
|
defaultValue: '',
|
||||||
inputUI: {
|
inputUI: {
|
||||||
type: 'text',
|
type: 'text',
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -217,6 +217,30 @@ const tests = [
|
||||||
+ ' Files has streams which need to be removed, processing \n',
|
+ ' 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);
|
void run(tests);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue