From 9dc6126f692564e0e5e2f89dbd02647c8425d3cc Mon Sep 17 00:00:00 2001 From: amd64fox <62529699+amd64fox@users.noreply.github.com> Date: Fri, 17 Oct 2025 12:51:34 +0300 Subject: [PATCH] fix: pass array instead of string for multiple block types #788 --- run.ps1 | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/run.ps1 b/run.ps1 index 82780c0..2bd7425 100644 --- a/run.ps1 +++ b/run.ps1 @@ -2125,19 +2125,20 @@ if ($test_spa) { if ($section -ne $null) { $calltype = switch ($true) { - ($podcast_off -and $adsections_off -and $canvashome_off) { 'all'; break } - ($podcast_off -and $adsections_off) { 'podcast, section'; break } - ($podcast_off -and $canvashome_off) { 'podcast, canvas'; break } - ($adsections_off -and $canvashome_off) { 'section, canvas'; break } - $podcast_off { 'podcast'; break } - $adsections_off { 'section'; break } - $canvashome_off { 'canvas'; break } + ($podcast_off -and $adsections_off -and $canvashome_off) { "'all'"; break } + ($podcast_off -and $adsections_off) { "['podcast', 'section']"; break } + ($podcast_off -and $canvashome_off) { "['podcast', 'canvas']"; break } + ($adsections_off -and $canvashome_off) { "['section', 'canvas']"; break } + $podcast_off { "'podcast'"; break } + $adsections_off { "'section'"; break } + $canvashome_off { "'canvas'"; break } default { $null } } - $section = $section -replace "sectionBlock\(data, ''\)", "sectionBlock(data, '$calltype')" - - injection -p $xpui_spa_patch -f "spotx-helper" -n "sectionBlock.js" -c $section + if (!($calltype -eq "'canvas'" -and [version]$offline -le [version]"1.2.52.442")) { + $section = $section -replace "sectionBlock\(data, ''\)", "sectionBlock(data, $calltype)" + injection -p $xpui_spa_patch -f "spotx-helper" -n "sectionBlock.js" -c $section + } } }