mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-09 23:48:15 -07:00
commit
a5bd5cd3b1
4 changed files with 37 additions and 10 deletions
|
|
@ -64,7 +64,7 @@ var plugin = function (args) {
|
|||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
var propertyToCheck = String(args.inputs.propertyToCheck).trim();
|
||||
var valuesToRemove = String(args.inputs.valuesToRemove).trim().split(',');
|
||||
var valuesToRemove = String(args.inputs.valuesToRemove).trim().split(',').map(function (item) { return item.trim(); });
|
||||
var condition = String(args.inputs.condition);
|
||||
args.variables.ffmpegCommand.streams.forEach(function (stream) {
|
||||
var _a;
|
||||
|
|
|
|||
|
|
@ -77,12 +77,15 @@ var plugin = function (args) {
|
|||
}
|
||||
}
|
||||
if (newContainer === 'mp4') {
|
||||
if ([
|
||||
'hdmv_pgs_subtitle',
|
||||
'eia_608',
|
||||
'timed_id3',
|
||||
'subrip',
|
||||
].includes(codecName)) {
|
||||
if (codecType === 'attachment'
|
||||
|| [
|
||||
'hdmv_pgs_subtitle',
|
||||
'eia_608',
|
||||
'timed_id3',
|
||||
'subrip',
|
||||
'ass',
|
||||
'ssa',
|
||||
].includes(codecName)) {
|
||||
stream.removed = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -92,6 +95,16 @@ var plugin = function (args) {
|
|||
}
|
||||
}
|
||||
}
|
||||
// handle genpts if coming from odd container
|
||||
var container = args.inputFileObj.container.toLowerCase();
|
||||
if ([
|
||||
'ts',
|
||||
'avi',
|
||||
'mpg',
|
||||
'mpeg',
|
||||
].includes(container)) {
|
||||
args.variables.ffmpegCommand.overallOuputArguments.push('-fflags', '+genpts');
|
||||
}
|
||||
}
|
||||
return {
|
||||
outputFileObj: args.inputFileObj,
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ const plugin = (args: IpluginInputArgs): IpluginOutputArgs => {
|
|||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
|
||||
const propertyToCheck = String(args.inputs.propertyToCheck).trim();
|
||||
const valuesToRemove = String(args.inputs.valuesToRemove).trim().split(',');
|
||||
const valuesToRemove = String(args.inputs.valuesToRemove).trim().split(',').map((item) => item.trim());
|
||||
const condition = String(args.inputs.condition);
|
||||
|
||||
args.variables.ffmpegCommand.streams.forEach((stream) => {
|
||||
|
|
@ -101,7 +101,6 @@ const plugin = (args: IpluginInputArgs): IpluginOutputArgs => {
|
|||
const prop = String(target).toLowerCase();
|
||||
for (let i = 0; i < valuesToRemove.length; i += 1) {
|
||||
const val = valuesToRemove[i].toLowerCase();
|
||||
|
||||
const prefix = `Removing stream index ${stream.index} because ${propertyToCheck} of ${prop}`;
|
||||
if (condition === 'includes' && prop.includes(val)) {
|
||||
args.jobLog(`${prefix} includes ${val}\n`);
|
||||
|
|
|
|||
|
|
@ -93,11 +93,14 @@ const plugin = (args: IpluginInputArgs): IpluginOutputArgs => {
|
|||
|
||||
if (newContainer === 'mp4') {
|
||||
if (
|
||||
[
|
||||
codecType === 'attachment'
|
||||
|| [
|
||||
'hdmv_pgs_subtitle',
|
||||
'eia_608',
|
||||
'timed_id3',
|
||||
'subrip',
|
||||
'ass',
|
||||
'ssa',
|
||||
].includes(codecName)
|
||||
) {
|
||||
stream.removed = true;
|
||||
|
|
@ -108,6 +111,18 @@ const plugin = (args: IpluginInputArgs): IpluginOutputArgs => {
|
|||
}
|
||||
}
|
||||
}
|
||||
// handle genpts if coming from odd container
|
||||
const container = args.inputFileObj.container.toLowerCase();
|
||||
if (
|
||||
[
|
||||
'ts',
|
||||
'avi',
|
||||
'mpg',
|
||||
'mpeg',
|
||||
].includes(container)
|
||||
) {
|
||||
args.variables.ffmpegCommand.overallOuputArguments.push('-fflags', '+genpts');
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue