diff options
-rw-r--r-- | server/tests/api/server/stats.ts | 2 | ||||
-rw-r--r-- | shared/extra-utils/ffprobe.ts | 11 |
2 files changed, 11 insertions, 2 deletions
diff --git a/server/tests/api/server/stats.ts b/server/tests/api/server/stats.ts index 6654eaaee..bc35cbe4e 100644 --- a/server/tests/api/server/stats.ts +++ b/server/tests/api/server/stats.ts | |||
@@ -26,7 +26,7 @@ describe('Test stats (excluding redundancy)', function () { | |||
26 | } | 26 | } |
27 | 27 | ||
28 | before(async function () { | 28 | before(async function () { |
29 | this.timeout(60000) | 29 | this.timeout(120000) |
30 | 30 | ||
31 | servers = await createMultipleServers(3) | 31 | servers = await createMultipleServers(3) |
32 | 32 | ||
diff --git a/shared/extra-utils/ffprobe.ts b/shared/extra-utils/ffprobe.ts index dfacd251c..b95202464 100644 --- a/shared/extra-utils/ffprobe.ts +++ b/shared/extra-utils/ffprobe.ts | |||
@@ -21,10 +21,19 @@ function ffprobePromise (path: string) { | |||
21 | // Audio | 21 | // Audio |
22 | // --------------------------------------------------------------------------- | 22 | // --------------------------------------------------------------------------- |
23 | 23 | ||
24 | const imageCodecs = new Set([ | ||
25 | 'ansi', 'apng', 'bintext', 'bmp', 'brender_pix', 'dpx', 'exr', 'fits', 'gem', 'gif', 'jpeg2000', 'jpgls', 'mjpeg', 'mjpegb', 'msp2', | ||
26 | 'pam', 'pbm', 'pcx', 'pfm', 'pgm', 'pgmyuv', 'pgx', 'photocd', 'pictor', 'png', 'ppm', 'psd', 'sgi', 'sunrast', 'svg', 'targa', 'tiff', | ||
27 | 'txd', 'webp', 'xbin', 'xbm', 'xface', 'xpm', 'xwd' | ||
28 | ]) | ||
29 | |||
24 | async function isAudioFile (path: string, existingProbe?: FfprobeData) { | 30 | async function isAudioFile (path: string, existingProbe?: FfprobeData) { |
25 | const videoStream = await getVideoStream(path, existingProbe) | 31 | const videoStream = await getVideoStream(path, existingProbe) |
32 | if (!videoStream) return true | ||
33 | |||
34 | if (imageCodecs.has(videoStream.codec_name)) return true | ||
26 | 35 | ||
27 | return !videoStream | 36 | return false |
28 | } | 37 | } |
29 | 38 | ||
30 | async function hasAudioStream (path: string, existingProbe?: FfprobeData) { | 39 | async function hasAudioStream (path: string, existingProbe?: FfprobeData) { |