Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove default #641

Merged
merged 7 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var details = function () { return ({
label: 'Variable',
name: 'variable',
type: 'string',
defaultValue: '{{{args.librarySettings._id}}}',
defaultValue: '',
inputUI: {
type: 'text',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const details = (): IpluginDetails => ({
label: 'Variable',
name: 'variable',
type: 'string',
defaultValue: '{{{args.librarySettings._id}}}',
defaultValue: '',
inputUI: {
type: 'text',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);