From 8cc8b44724fd28d0e4c72ab81ed1451b4650ee24 Mon Sep 17 00:00:00 2001 From: canove Date: Mon, 5 May 2025 21:33:35 -0300 Subject: [PATCH] chore: lint --- src/Utils/messages.ts | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/Utils/messages.ts b/src/Utils/messages.ts index 335933d..510d3dc 100644 --- a/src/Utils/messages.ts +++ b/src/Utils/messages.ts @@ -155,14 +155,14 @@ export const prepareWAMessageMedia = async( (typeof uploadData['jpegThumbnail'] === 'undefined') const requiresWaveformProcessing = mediaType === 'audio' && uploadData.ptt === true const requiresAudioBackground = options.backgroundColor && mediaType === 'audio' && uploadData.ptt === true - const requiresOriginalForSomeProcessing = requiresDurationComputation || requiresThumbnailComputation + const requiresOriginalForSomeProcessing = requiresDurationComputation || requiresThumbnailComputation const { mediaKey, encFilePath, originalFilePath, fileEncSha256, fileSha256, - fileLength + fileLength } = await encryptedStream( uploadData.media, options.mediaTypeOverride || mediaType, @@ -221,13 +221,16 @@ export const prepareWAMessageMedia = async( ]) .finally( async() => { - try { - await fs.unlink(encFilePath) - if (originalFilePath) await fs.unlink(originalFilePath) - logger?.debug('removed tmp files') - } catch(error) { - logger?.warn('failed to remove tmp file') - } + try { + await fs.unlink(encFilePath) + if(originalFilePath) { + await fs.unlink(originalFilePath) + } + + logger?.debug('removed tmp files') + } catch(error) { + logger?.warn('failed to remove tmp file') + } } )