mirror of
https://github.com/SpotX-Official/SpotX.git
synced 2026-08-09 09:31:09 +10:00
Hiding ad-like sections
- attempt to hide ad-like sections from the homepage https://github.com/SpotX-CLI/SpotX-Win/issues/195
This commit is contained in:
+31
-6
@@ -1,9 +1,12 @@
|
||||
param
|
||||
(
|
||||
[Parameter(HelpMessage = 'Remove podcasts/episodes/audiobooks from homepage.')]
|
||||
[Parameter(HelpMessage = 'Hiding podcasts/episodes/audiobooks from homepage.')]
|
||||
[switch]$podcasts_off,
|
||||
|
||||
[Parameter(HelpMessage = 'Do not remove podcasts/episodes/audiobooks from homepage.')]
|
||||
[Parameter(HelpMessage = 'Hiding Ad-like sections from the homepage')]
|
||||
[switch]$adsections_off,
|
||||
|
||||
[Parameter(HelpMessage = 'Do not hiding podcasts/episodes/audiobooks from homepage.')]
|
||||
[switch]$podcasts_on,
|
||||
|
||||
[Parameter(HelpMessage = 'Block Spotify automatic updates.')]
|
||||
@@ -1030,12 +1033,20 @@ function Helper($paramname) {
|
||||
}
|
||||
"OffPodcasts" {
|
||||
# Turn off podcasts
|
||||
if ($offline -le "1.1.92.647") { $contents = "podcastsoff" }
|
||||
if ($offline -ge "1.1.93.896" -and $offline -le "1.1.96.785") { $contents = "podcastsoff2" }
|
||||
if ($offline -ge "1.1.97.952") { $contents = "podcastsoff3" }
|
||||
$n = $js
|
||||
if ($offline -le "1.1.92.647") { $podcats = "podcastsoff" }
|
||||
if ($offline -ge "1.1.93.896" -and $offline -le "1.1.96.785") { $podcats = "podcastsoff2" }
|
||||
if ($offline -ge "1.1.97.952") { $podcats = "podcastsoff3" }
|
||||
$name = "patches.json.others."
|
||||
$contents = $podcats
|
||||
$json = $webjson.others
|
||||
}
|
||||
"OffAdSections" {
|
||||
# Hiding Ad-like sections from the homepage
|
||||
if ($offline -le "1.1.96.785") { $webjson.others.adsectionsoff.replace = '$1 if ($3' + $webjson.others.adsectionsoff.replace }
|
||||
else { $webjson.others.adsectionsoff.replace = '$1 if ($4' + $webjson.others.adsectionsoff.replace }
|
||||
$n = $js
|
||||
$name = "patches.json.others."
|
||||
$contents = "adsectionsoff"
|
||||
$json = $webjson.others
|
||||
}
|
||||
"OffRujs" {
|
||||
@@ -1309,6 +1320,13 @@ if (Test-Path $xpui_js_patch) {
|
||||
extract -counts 'one' -method 'nonezip' -name $js -helper 'OffPodcasts'
|
||||
}
|
||||
|
||||
# Hiding Ad-like sections from the homepage
|
||||
if ($adsections_off) {
|
||||
if ($offline -ge "1.1.93.896" -and $offline -le "1.1.97.962") { $js = 'home-v2.js' }
|
||||
if ($offline -ge "1.1.98.683") { $js = 'xpui.js' }
|
||||
extract -counts 'one' -method 'nonezip' -name $js -helper 'OffAdSections'
|
||||
}
|
||||
|
||||
# Static color for lyrics
|
||||
if ($lyrics_stat) {
|
||||
if ($offline -lt "1.1.99.871") {
|
||||
@@ -1424,6 +1442,13 @@ If (Test-Path $xpui_spa_patch) {
|
||||
extract -counts 'one' -method 'zip' -name $js -helper 'OffPodcasts'
|
||||
}
|
||||
|
||||
# Hiding Ad-like sections from the homepage
|
||||
if ($adsections_off) {
|
||||
if ($offline -ge "1.1.93.896" -and $offline -le "1.1.97.962") { $js = 'home-v2.js' }
|
||||
if ($offline -ge "1.1.98.683") { $js = 'xpui.js' }
|
||||
extract -counts 'one' -method 'zip' -name $js -helper 'OffAdSections'
|
||||
}
|
||||
|
||||
# Hide Collaborators icon
|
||||
if (!($hide_col_icon_off) -and !($exp_spotify)) {
|
||||
extract -counts 'one' -method 'zip' -name 'xpui-routes-playlist.js' -helper 'Collaborators'
|
||||
|
||||
Reference in New Issue
Block a user