Skip to content

Commit

Permalink
Re-apply Spicetify after Spotify reinstall
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafiuth committed Dec 11, 2023
1 parent b6a638a commit 3f64538
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions SpotifyOggDumper/Data/Install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function CheckOrInstallSpotify {

Write-Host "Installing..."

# Remove everything but user folders, to avoid conflicts with Spicetify extracted files
# Remove everything but user folders, to prevent conflicts with Spicetify extracted files
Remove-Item -Path $SpotifyDir -Recurse -Exclude ("Users\", "prefs") -ErrorAction SilentlyContinue

# Other undocumented switches: /extract /log-file
Expand All @@ -66,6 +66,12 @@ function CheckOrInstallSpotify {
$src = [System.Text.Encoding]::UTF8.GetString($src);
Invoke-Expression "& { $src } $flags -new_theme -block_update_on -version $SpotifyVersionWithCommit"
}

where.exe /q spicetify
if ($LastExitCode -eq 0) {
Write-Host "Re-applying Spicetify..."
spicetify.exe backup apply --no-restart
}
}
function InstallFFmpeg {
where.exe /q ffmpeg
Expand All @@ -79,7 +85,7 @@ function InstallFFmpeg {
Remove-Item -Path "$env:LOCALAPPDATA\Soggfy\ffmpeg\" -Recurse -Force
}
$arch = $(if ([Environment]::Is64BitOperatingSystem) { "win64" } else { "win32" })
$release = Invoke-WebRequest "https://api.github.com/repos/AnimMouse/ffmpeg-autobuild/releases/latest" -UseBasicParsing | ConvertFrom-Json
$release = Invoke-WebRequest "https://api.github.com/repos/AnimMouse/ffmpeg-stable-autobuild/releases/latest" -UseBasicParsing | ConvertFrom-Json
$asset = $release.assets | Where-Object { $_.name.Contains($arch) } | Select-Object -First 1

DownloadFile -Url $asset.browser_download_url -DestPath "$temp/$($asset.name)"
Expand Down

0 comments on commit 3f64538

Please sign in to comment.