From a59ecd14e7343c8b9e221a2a4397a86e4956147b Mon Sep 17 00:00:00 2001 From: dumbmoron <136796770+dumbmoron@users.noreply.github.com> Date: Sun, 20 Aug 2023 16:11:42 +0000 Subject: [PATCH 1/2] use else-if instead of if for evaluating action sets a fixed order of actions --- src/modules/processing/matchActionDecider.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/modules/processing/matchActionDecider.js b/src/modules/processing/matchActionDecider.js index 2faa991c..3d96db62 100644 --- a/src/modules/processing/matchActionDecider.js +++ b/src/modules/processing/matchActionDecider.js @@ -13,12 +13,12 @@ export default function(r, host, audioFormat, isAudioOnly, lang, isAudioMuted) { }, params = {} - if (!isAudioOnly && !r.picker && !isAudioMuted) action = "video"; - if (r.isM3U8) action = "singleM3U8"; - if (isAudioOnly && !r.picker) action = "audio"; - if (r.picker) action = "picker"; - if (isAudioMuted) action = "muteVideo"; - if (r.isPhoto) action = "photo"; + if (r.picker) action = "picker" + else if (r.isPhoto) action = "photo"; + else if (r.isM3U8) action = "singleM3U8"; + else if (isAudioOnly) action = "audio"; + else if (isAudioMuted) action = "muteVideo"; + else action = "video"; if (action === "picker" || action === "audio") { defaultParams.filename = r.audioFilename; From 9d590a64dc3fdaec836529a0312fe065809b70d4 Mon Sep 17 00:00:00 2001 From: wukko Date: Sun, 20 Aug 2023 22:30:26 +0600 Subject: [PATCH 2/2] fix the order --- src/modules/processing/matchActionDecider.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/processing/matchActionDecider.js b/src/modules/processing/matchActionDecider.js index 3d96db62..c2db9176 100644 --- a/src/modules/processing/matchActionDecider.js +++ b/src/modules/processing/matchActionDecider.js @@ -13,11 +13,11 @@ export default function(r, host, audioFormat, isAudioOnly, lang, isAudioMuted) { }, params = {} - if (r.picker) action = "picker" - else if (r.isPhoto) action = "photo"; - else if (r.isM3U8) action = "singleM3U8"; - else if (isAudioOnly) action = "audio"; + if (r.isPhoto) action = "photo"; + else if (r.picker) action = "picker" else if (isAudioMuted) action = "muteVideo"; + else if (isAudioOnly) action = "audio"; + else if (r.isM3U8) action = "singleM3U8"; else action = "video"; if (action === "picker" || action === "audio") {