mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-14 09:45:55 -07:00
Add Tdarr_Plugin_00td_filter_by_stream_tag
This commit is contained in:
parent
69b90d3879
commit
317d74520b
2 changed files with 307 additions and 0 deletions
190
tests/Community/Tdarr_Plugin_00td_filter_by_stream_tag.js
Normal file
190
tests/Community/Tdarr_Plugin_00td_filter_by_stream_tag.js
Normal file
|
|
@ -0,0 +1,190 @@
|
|||
/* eslint max-len: 0 */
|
||||
const _ = require('lodash');
|
||||
const run = require('../helpers/run');
|
||||
|
||||
const tests = [
|
||||
{
|
||||
input: {
|
||||
file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')),
|
||||
librarySettings: {},
|
||||
inputs: {},
|
||||
otherArguments: {},
|
||||
},
|
||||
output: {
|
||||
processFile: true,
|
||||
infoLog: 'A stream with tag name COPYRIGHT containing processed has not been found, continuing to next plugin \n',
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
input: {
|
||||
file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')),
|
||||
librarySettings: {},
|
||||
inputs: {
|
||||
tagName: 'COPYRIGHT',
|
||||
tagValues: 'processed',
|
||||
continueIfTagFound: false,
|
||||
|
||||
},
|
||||
otherArguments: {},
|
||||
},
|
||||
output: {
|
||||
processFile: true,
|
||||
infoLog: 'A stream with tag name COPYRIGHT containing processed has not been found, continuing to next plugin \n',
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
input: {
|
||||
file: (() => {
|
||||
const file = _.cloneDeep(require('../sampleData/media/sampleH265_1.json'));
|
||||
file.ffProbeData.streams[0].tags.COPYRIGHT = 'processed';
|
||||
return file;
|
||||
})(),
|
||||
librarySettings: {},
|
||||
inputs: {
|
||||
tagName: 'COPYRIGHT',
|
||||
tagValues: 'processed',
|
||||
continueIfTagFound: false,
|
||||
|
||||
},
|
||||
otherArguments: {},
|
||||
},
|
||||
output: {
|
||||
processFile: false,
|
||||
infoLog: 'A stream with tag name COPYRIGHT containing processed has been found, breaking out of stack \n',
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
input: {
|
||||
file: (() => {
|
||||
const file = _.cloneDeep(require('../sampleData/media/sampleH265_1.json'));
|
||||
file.ffProbeData.streams[1].tags.COPYRIGHT = 'processed';
|
||||
return file;
|
||||
})(),
|
||||
librarySettings: {},
|
||||
inputs: {
|
||||
tagName: 'COPYRIGHT',
|
||||
tagValues: 'proc,processed',
|
||||
continueIfTagFound: false,
|
||||
|
||||
},
|
||||
otherArguments: {},
|
||||
},
|
||||
output: {
|
||||
processFile: false,
|
||||
infoLog: 'A stream with tag name COPYRIGHT containing proc,processed has been found, breaking out of stack \n',
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
input: {
|
||||
file: (() => {
|
||||
const file = _.cloneDeep(require('../sampleData/media/sampleH265_1.json'));
|
||||
file.ffProbeData.streams[0].tags.COPYRIGHT = 'processed';
|
||||
return file;
|
||||
})(),
|
||||
librarySettings: {},
|
||||
inputs: {
|
||||
tagName: 'COPYRIGHT',
|
||||
tagValues: 'proc,proce',
|
||||
continueIfTagFound: false,
|
||||
|
||||
},
|
||||
otherArguments: {},
|
||||
},
|
||||
output: {
|
||||
processFile: true,
|
||||
infoLog: 'A stream with tag name COPYRIGHT containing proc,proce has not been found, continuing to next plugin \n',
|
||||
},
|
||||
},
|
||||
|
||||
// continueIfTagFound: true
|
||||
|
||||
{
|
||||
input: {
|
||||
file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')),
|
||||
librarySettings: {},
|
||||
inputs: {
|
||||
tagName: 'COPYRIGHT',
|
||||
tagValues: 'processed',
|
||||
continueIfTagFound: true,
|
||||
|
||||
},
|
||||
otherArguments: {},
|
||||
},
|
||||
output: {
|
||||
processFile: false,
|
||||
infoLog: 'A stream with tag name COPYRIGHT containing processed has not been found, breaking out of stack \n',
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
input: {
|
||||
file: (() => {
|
||||
const file = _.cloneDeep(require('../sampleData/media/sampleH265_1.json'));
|
||||
file.ffProbeData.streams[0].tags.COPYRIGHT = 'processed';
|
||||
return file;
|
||||
})(),
|
||||
librarySettings: {},
|
||||
inputs: {
|
||||
tagName: 'COPYRIGHT',
|
||||
tagValues: 'processed',
|
||||
continueIfTagFound: true,
|
||||
|
||||
},
|
||||
otherArguments: {},
|
||||
},
|
||||
output: {
|
||||
processFile: true,
|
||||
infoLog: 'A stream with tag name COPYRIGHT containing processed has been found, continuing to next plugin \n',
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
input: {
|
||||
file: (() => {
|
||||
const file = _.cloneDeep(require('../sampleData/media/sampleH265_1.json'));
|
||||
file.ffProbeData.streams[1].tags.COPYRIGHT = 'processed';
|
||||
return file;
|
||||
})(),
|
||||
librarySettings: {},
|
||||
inputs: {
|
||||
tagName: 'COPYRIGHT',
|
||||
tagValues: 'proc,processed',
|
||||
continueIfTagFound: true,
|
||||
|
||||
},
|
||||
otherArguments: {},
|
||||
},
|
||||
output: {
|
||||
processFile: true,
|
||||
infoLog: 'A stream with tag name COPYRIGHT containing proc,processed has been found, continuing to next plugin \n',
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
input: {
|
||||
file: (() => {
|
||||
const file = _.cloneDeep(require('../sampleData/media/sampleH265_1.json'));
|
||||
file.ffProbeData.streams[0].tags.COPYRIGHT = 'processed';
|
||||
return file;
|
||||
})(),
|
||||
librarySettings: {},
|
||||
inputs: {
|
||||
tagName: 'COPYRIGHT',
|
||||
tagValues: 'proc,proce',
|
||||
continueIfTagFound: true,
|
||||
|
||||
},
|
||||
otherArguments: {},
|
||||
},
|
||||
output: {
|
||||
processFile: false,
|
||||
infoLog: 'A stream with tag name COPYRIGHT containing proc,proce has not been found, breaking out of stack \n',
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
run(tests);
|
||||
Loading…
Add table
Add a link
Reference in a new issue