diff options
author | Chocobozzz <me@florianbigard.com> | 2022-11-15 15:00:19 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-11-15 15:00:23 +0100 |
commit | 99b757488c077cee7d0ab89eeec181a7ee6290eb (patch) | |
tree | 307a3f39285f899e3ed616d92aae1bdd181178e0 /server/helpers | |
parent | 4638cd713dcdd007cd7f49b9a95fa62ac7823e7c (diff) | |
download | PeerTube-99b757488c077cee7d0ab89eeec181a7ee6290eb.tar.gz PeerTube-99b757488c077cee7d0ab89eeec181a7ee6290eb.tar.zst PeerTube-99b757488c077cee7d0ab89eeec181a7ee6290eb.zip |
Fix server lint
Diffstat (limited to 'server/helpers')
-rw-r--r-- | server/helpers/custom-validators/misc.ts | 2 | ||||
-rw-r--r-- | server/helpers/ffmpeg/ffmpeg-commons.ts | 2 | ||||
-rw-r--r-- | server/helpers/youtube-dl/youtube-dl-wrapper.ts | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/server/helpers/custom-validators/misc.ts b/server/helpers/custom-validators/misc.ts index 17750379d..3dc5504e3 100644 --- a/server/helpers/custom-validators/misc.ts +++ b/server/helpers/custom-validators/misc.ts | |||
@@ -86,7 +86,7 @@ function isFileValid (options: { | |||
86 | 86 | ||
87 | // The file exists | 87 | // The file exists |
88 | const file = fileArray[0] | 88 | const file = fileArray[0] |
89 | if (!file || !file.originalname) return false | 89 | if (!file?.originalname) return false |
90 | 90 | ||
91 | // Check size | 91 | // Check size |
92 | if ((maxSize !== null) && file.size > maxSize) return false | 92 | if ((maxSize !== null) && file.size > maxSize) return false |
diff --git a/server/helpers/ffmpeg/ffmpeg-commons.ts b/server/helpers/ffmpeg/ffmpeg-commons.ts index b01989899..3906a2089 100644 --- a/server/helpers/ffmpeg/ffmpeg-commons.ts +++ b/server/helpers/ffmpeg/ffmpeg-commons.ts | |||
@@ -38,7 +38,7 @@ function getFFmpegVersion () { | |||
38 | return execPromise(`${ffmpegPath} -version`) | 38 | return execPromise(`${ffmpegPath} -version`) |
39 | .then(stdout => { | 39 | .then(stdout => { |
40 | const parsed = stdout.match(/ffmpeg version .?(\d+\.\d+(\.\d+)?)/) | 40 | const parsed = stdout.match(/ffmpeg version .?(\d+\.\d+(\.\d+)?)/) |
41 | if (!parsed || !parsed[1]) return rej(new Error(`Could not find ffmpeg version in ${stdout}`)) | 41 | if (!parsed?.[1]) return rej(new Error(`Could not find ffmpeg version in ${stdout}`)) |
42 | 42 | ||
43 | // Fix ffmpeg version that does not include patch version (4.4 for example) | 43 | // Fix ffmpeg version that does not include patch version (4.4 for example) |
44 | let version = parsed[1] | 44 | let version = parsed[1] |
diff --git a/server/helpers/youtube-dl/youtube-dl-wrapper.ts b/server/helpers/youtube-dl/youtube-dl-wrapper.ts index 966b8df78..ac3cd190e 100644 --- a/server/helpers/youtube-dl/youtube-dl-wrapper.ts +++ b/server/helpers/youtube-dl/youtube-dl-wrapper.ts | |||
@@ -77,7 +77,7 @@ class YoutubeDLWrapper { | |||
77 | 77 | ||
78 | const subtitles = files.reduce((acc, filename) => { | 78 | const subtitles = files.reduce((acc, filename) => { |
79 | const matched = filename.match(/\.([a-z]{2})(-[a-z]+)?\.(vtt|ttml)/i) | 79 | const matched = filename.match(/\.([a-z]{2})(-[a-z]+)?\.(vtt|ttml)/i) |
80 | if (!matched || !matched[1]) return acc | 80 | if (!matched?.[1]) return acc |
81 | 81 | ||
82 | return [ | 82 | return [ |
83 | ...acc, | 83 | ...acc, |