mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-13 01:10:27 -07:00
Add dropdowns to plugin and update tests
This commit is contained in:
parent
e429966de2
commit
2f10ece96e
2 changed files with 16 additions and 11 deletions
|
|
@ -10,11 +10,12 @@ const details = () => ({
|
||||||
Tags: 'pre-processing,ffmpeg,audio only,configurable',
|
Tags: 'pre-processing,ffmpeg,audio only,configurable',
|
||||||
Inputs: [{
|
Inputs: [{
|
||||||
name: 'aac_stereo',
|
name: 'aac_stereo',
|
||||||
type: 'string',
|
type: 'boolean',
|
||||||
defaultValue: '',
|
defaultValue: false,
|
||||||
inputUI: {
|
options: [
|
||||||
type: 'text',
|
'false',
|
||||||
},
|
'true',
|
||||||
|
],
|
||||||
tooltip: `Specify if any 2.0 audio tracks should be converted to aac for maximum compatability with devices.
|
tooltip: `Specify if any 2.0 audio tracks should be converted to aac for maximum compatability with devices.
|
||||||
\\nOptional.
|
\\nOptional.
|
||||||
\\nExample:\\n
|
\\nExample:\\n
|
||||||
|
|
@ -25,10 +26,14 @@ const details = () => ({
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'downmix',
|
name: 'downmix',
|
||||||
type: 'string',
|
type: 'boolean',
|
||||||
defaultValue: '',
|
defaultValue: false,
|
||||||
inputUI: {
|
inputUI: {
|
||||||
type: 'text',
|
type: 'dropdown',
|
||||||
|
options: [
|
||||||
|
'false',
|
||||||
|
'true',
|
||||||
|
],
|
||||||
},
|
},
|
||||||
tooltip: `Specify if downmixing should be used to create extra audio tracks.
|
tooltip: `Specify if downmixing should be used to create extra audio tracks.
|
||||||
\\nI.e if you have an 8ch but no 2ch or 6ch, create the missing audio tracks from the 8 ch.
|
\\nI.e if you have an 8ch but no 2ch or 6ch, create the missing audio tracks from the 8 ch.
|
||||||
|
|
@ -120,7 +125,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => {
|
||||||
// Catch error here incase user left inputs.downmix empty.
|
// Catch error here incase user left inputs.downmix empty.
|
||||||
try {
|
try {
|
||||||
// Check if inputs.downmix is set to true.
|
// Check if inputs.downmix is set to true.
|
||||||
if (inputs.downmix.toLowerCase() === 'true') {
|
if (inputs.downmix === true) {
|
||||||
// Check if file has 8 channel audio but no 6 channel, if so then create extra downmix from the 8 channel.
|
// Check if file has 8 channel audio but no 6 channel, if so then create extra downmix from the 8 channel.
|
||||||
if (
|
if (
|
||||||
file.ffProbeData.streams[i].channels === 8
|
file.ffProbeData.streams[i].channels === 8
|
||||||
|
|
@ -154,7 +159,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => {
|
||||||
// Catch error here incase user left inputs.downmix empty.
|
// Catch error here incase user left inputs.downmix empty.
|
||||||
try {
|
try {
|
||||||
// Check if inputs.aac_stereo is set to true.
|
// Check if inputs.aac_stereo is set to true.
|
||||||
if (inputs.aac_stereo === 'true') {
|
if (inputs.aac_stereo === true) {
|
||||||
// Check if codec_name for stream is NOT aac AND check if channel ammount is 2.
|
// Check if codec_name for stream is NOT aac AND check if channel ammount is 2.
|
||||||
if (
|
if (
|
||||||
file.ffProbeData.streams[i].codec_name !== 'aac'
|
file.ffProbeData.streams[i].codec_name !== 'aac'
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ const tests = [
|
||||||
handBrakeMode: false,
|
handBrakeMode: false,
|
||||||
FFmpegMode: true,
|
FFmpegMode: true,
|
||||||
reQueueAfter: true,
|
reQueueAfter: true,
|
||||||
infoLog: '☒Plugin has not been configured, please configure required options. Skipping this plugin. \n',
|
infoLog: '☑File contains all required audio formats. \n',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue