From 36622fc7acf6718a9c3964f8b50199b3057821be Mon Sep 17 00:00:00 2001 From: wukko Date: Sun, 20 Aug 2023 15:42:57 +0600 Subject: [PATCH] collapsed two lines --- src/modules/stream/types.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/modules/stream/types.js b/src/modules/stream/types.js index f1725bee..dc53405a 100644 --- a/src/modules/stream/types.js +++ b/src/modules/stream/types.js @@ -5,10 +5,7 @@ import { ffmpegArgs, genericUserAgent } from "../config.js"; import { getThreads, metadataManager, msToTime } from "../sub/utils.js"; function fail(res) { - if (!res.headersSent) { - res.sendStatus(500); - } - + if (!res.headersSent) res.sendStatus(500); return res.destroy(); } @@ -32,9 +29,7 @@ export function streamDefault(streamInfo, res) { } export function streamLiveRender(streamInfo, res) { try { - if (streamInfo.urls.length !== 2) { - return fail(res); - } + if (streamInfo.urls.length !== 2) return fail(res); let audio = got.get(streamInfo.urls[1], { isStream: true }); let format = streamInfo.filename.split('.')[streamInfo.filename.split('.').length - 1], args = [