🐛 Fix settings in AWS Transcribe node (#1860)

* Fixe uninitialized object when settings enabled

* 👕 Fix linter warning

*  Fix options name

* 🔥 Remove unused setting

*  Improvements

Co-authored-by: Alexander Mustafin <sashker@users.noreply.github.com>
Co-authored-by: ricardo <ricardoespinoza105@gmail.com>
This commit is contained in:
Iván Ovejero 2021-06-06 21:00:57 +02:00 committed by GitHub
parent 114fd3b3a6
commit 26bdc5c924
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -426,6 +426,7 @@ export class AwsTranscribe implements INodeType {
Media: { Media: {
MediaFileUri: mediaFileUri, MediaFileUri: mediaFileUri,
}, },
Settings: {},
}; };
if (detectLang) { if (detectLang) {
@ -438,16 +439,16 @@ export class AwsTranscribe implements INodeType {
Object.assign(body.Settings, { ChannelIdentification: options.channelIdentification }); Object.assign(body.Settings, { ChannelIdentification: options.channelIdentification });
} }
if (options.MaxAlternatives) { if (options.maxAlternatives) {
Object.assign(body.Settings, { Object.assign(body.Settings, {
ShowAlternatives: options.maxAlternatives, ShowAlternatives: true,
MaxAlternatives: options.maxAlternatives, MaxAlternatives: options.maxAlternatives,
}); });
} }
if (options.showSpeakerLabels) { if (options.maxSpeakerLabels) {
Object.assign(body.Settings, { Object.assign(body.Settings, {
ShowSpeakerLabels: options.showSpeakerLabels, ShowSpeakerLabels: true,
MaxSpeakerLabels: options.maxSpeakerLabels, MaxSpeakerLabels: options.maxSpeakerLabels,
}); });
} }