fix: pass array instead of string for multiple block types

#788
This commit is contained in:
amd64fox
2025-10-17 12:51:34 +03:00
parent 49b0a3ffc2
commit 9dc6126f69

19
run.ps1
View File

@@ -2125,20 +2125,21 @@ 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')"
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
}
}
}