- Minor fix
- typos
This commit is contained in:
amd64fox
2021-11-13 15:55:22 +03:00
parent 03a7a2c126
commit b11eef040f
7 changed files with 36 additions and 36 deletions

View File

@@ -549,7 +549,7 @@ if ($ch -eq 'y') {
if ($ch -match "^[1-9][0-9]?$|^100$") {
$file_cache_spotify_ps1 = Get-Content $env:APPDATA\Spotify\cache-spotify.ps1 -Raw
$new_file_cache_spotify_ps1 = $file_cache_spotify_ps1 -replace 'seven', $ch -replace '-7', - $ch
$new_file_cache_spotify_ps1 = $file_cache_spotify_ps1 -replace '-7', - $ch
Set-Content -Path $env:APPDATA\Spotify\cache-spotify.ps1 -Force -Value $new_file_cache_spotify_ps1
$contentcache_spotify_ps1 = [System.IO.File]::ReadAllText("$env:APPDATA\Spotify\cache-spotify.ps1")
$contentcache_spotify_ps1 = $contentcache_spotify_ps1.Trim()

View File

@@ -549,7 +549,7 @@ if ($ch -eq 'y') {
if ($ch -match "^[1-9][0-9]?$|^100$") {
$file_cache_spotify_ps1 = Get-Content $env:APPDATA\Spotify\cache-spotify.ps1 -Raw
$new_file_cache_spotify_ps1 = $file_cache_spotify_ps1 -replace 'seven', $ch -replace '-7', - $ch
$new_file_cache_spotify_ps1 = $file_cache_spotify_ps1 -replace '-7', - $ch
Set-Content -Path $env:APPDATA\Spotify\cache-spotify.ps1 -Force -Value $new_file_cache_spotify_ps1
$contentcache_spotify_ps1 = [System.IO.File]::ReadAllText("$env:APPDATA\Spotify\cache-spotify.ps1")
$contentcache_spotify_ps1 = $contentcache_spotify_ps1.Trim()

View File

@@ -75,4 +75,4 @@ If you are using Windows 7 or Windows 8.1, there may be errors in the installati
* SpotX will only work correctly on the latest versions of Spotify, please make sure of this before asking a question.
* The modifiable files are replaced by the Spotify installer every time it is updated, so you will need to apply the patch again when this happens.
* SpotX will be installed even if you are using Spicetify, but you may need to run Install.bat again after running the `spicetify apply` command.
* SpotX will be installed even if you are using Spicetify, but you may need to run Install.bat again after running the `spicetify apply` or other commands.

View File

@@ -1,3 +1,3 @@
command = "powershell.exe -ExecutionPolicy Bypass -nologo -noninteractive -command %appdata%\Spotify\cache-spotify.ps1"
command = "powershell.exe -ExecutionPolicy Bypass -nologo -noninteractive -command %Appdata%\Spotify\cache-spotify.ps1"
set shell = CreateObject("WScript.Shell")
shell.Run command,0, false

View File

@@ -6,31 +6,31 @@ echo *****************
echo Removing Patch...
if exist "%APPDATA%\Spotify\chrome_elf_bak.dll" (
del /s /q "%APPDATA%\Spotify\chrome_elf.dll" > NUL 2>&1
move "%APPDATA%\Spotify\chrome_elf_bak.dll" "%APPDATA%\Spotify\chrome_elf.dll" > NUL 2>&1
if exist "%Appdata%\Spotify\chrome_elf_bak.dll" (
del /s /q "%Appdata%\Spotify\chrome_elf.dll" > NUL 2>&1
move "%Appdata%\Spotify\chrome_elf_bak.dll" "%Appdata%\Spotify\chrome_elf.dll" > NUL 2>&1
)
if exist "%APPDATA%\Spotify\config.ini" (
del /s /q "%APPDATA%\Spotify\config.ini" > NUL 2>&1
if exist "%Appdata%\Spotify\config.ini" (
del /s /q "%Appdata%\Spotify\config.ini" > NUL 2>&1
)
if exist "%APPDATA%\Spotify\Apps\xpui.bak" (
del /s /q "%APPDATA%\Spotify\Apps\xpui.spa" > NUL 2>&1
move "%APPDATA%\Spotify\Apps\xpui.bak" "%APPDATA%\Spotify\Apps\xpui.spa" > NUL 2>&1
if exist "%Appdata%\Spotify\Apps\xpui.bak" (
del /s /q "%Appdata%\Spotify\Apps\xpui.spa" > NUL 2>&1
move "%Appdata%\Spotify\Apps\xpui.bak" "%Appdata%\Spotify\Apps\xpui.spa" > NUL 2>&1
)
if exist "%APPDATA%\Spotify\Apps\xpui\xpui.js.bak" (
del /s /q "%APPDATA%\Spotify\Apps\xpui\xpui.js" > NUL 2>&1
move "%APPDATA%\Spotify\Apps\xpui\xpui.js.bak" "%APPDATA%\Spotify\Apps\xpui\xpui.js" > NUL 2>&1
if exist "%Appdata%\Spotify\Apps\xpui\xpui.js.bak" (
del /s /q "%Appdata%\Spotify\Apps\xpui\xpui.js" > NUL 2>&1
move "%Appdata%\Spotify\Apps\xpui\xpui.js.bak" "%Appdata%\Spotify\Apps\xpui\xpui.js" > NUL 2>&1
)
if exist "%APPDATA%\Spotify\blockthespot_log.txt" (
del /s /q "%APPDATA%\Spotify\blockthespot_log.txt" > NUL 2>&1
if exist "%Appdata%\Spotify\blockthespot_log.txt" (
del /s /q "%Appdata%\Spotify\blockthespot_log.txt" > NUL 2>&1
)
@@ -39,28 +39,28 @@ if exist "%localappdata%\Spotify\Update" (
)
if exist "%APPDATA%\Spotify\SpotifyMigrator.bak" (
rename %APPDATA%\Spotify\SpotifyMigrator.bak SpotifyMigrator.exe > NUL 2>&1
if exist "%Appdata%\Spotify\SpotifyMigrator.bak" (
rename %Appdata%\Spotify\SpotifyMigrator.bak SpotifyMigrator.exe > NUL 2>&1
)
if exist "%APPDATA%\Spotify\SpotifyMigrator.exe" (
if exist "%APPDATA%\Spotify\SpotifyMigrator.bak" (
del /f /s /q %APPDATA%\Spotify\SpotifyMigrator.bak > NUL 2>&1
if exist "%Appdata%\Spotify\SpotifyMigrator.exe" (
if exist "%Appdata%\Spotify\SpotifyMigrator.bak" (
del /f /s /q %Appdata%\Spotify\SpotifyMigrator.bak > NUL 2>&1
)
)
if exist "%APPDATA%\Spotify\Spotify.vbs" (
del /f /s /q %APPDATA%\Spotify\Spotify.vbs > NUL 2>&1
if exist "%Appdata%\Spotify\Spotify.vbs" (
del /f /s /q %Appdata%\Spotify\Spotify.vbs > NUL 2>&1
)
if exist "%APPDATA%\Spotify\cache-spotify.ps1" (
del /f /s /q %APPDATA%\Spotify\cache-spotify.ps1 > NUL 2>&1
del /f /s /q %USERPROFILE%\Desktop\Spotify.lnk > NUL 2>&1
if exist "%Appdata%\Spotify\cache-spotify.ps1" (
del /f /s /q %Appdata%\Spotify\cache-spotify.ps1 > NUL 2>&1
del /f /s /q %Userprofile%\Desktop\Spotify.lnk > NUL 2>&1
SET Esc_LinkDest=%USERPROFILE%\Desktop\Spotify.lnk
SET Esc_LinkTarget=%APPDATA%\Spotify\Spotify.exe
SET Esc_WorkLinkTarget=%APPDATA%\Spotify\
SET Esc_LinkDest=%Userprofile%\Desktop\Spotify.lnk
SET Esc_LinkTarget=%Appdata%\Spotify\Spotify.exe
SET Esc_WorkLinkTarget=%Appdata%\Spotify\
SET cSctVBS=CreateShortcut.vbs
((
echo Set oWS = WScript.CreateObject^("WScript.Shell"^)

View File

@@ -1,13 +1,13 @@
# Launch Spotify.exe and wait for the process to stop
Start-Process -FilePath $env:APPDATA\Spotify\Spotify.exe; wait-process -name Spotify
# This block deletes files by the last access time to it, files that have not been changed and have not been opened for more than the number of days you have selected will be deleted. (number of days = seven)
# This block deletes files by the last access time to it, files that have not been changed and have not been opened for more than the number of days you have selected will be deleted. If you need to replace with another number of days, then substitute the value in the 6th row and 113th column (The default is 7 days).
If(Test-Path -Path $env:LOCALAPPDATA\Spotify\Data){
dir $env:LOCALAPPDATA\Spotify\Data -File -Recurse |? lastaccesstime -lt (get-date).AddDays(-7) |del
Get-ChildItem $env:LOCALAPPDATA\Spotify\Data -File -Recurse |Where-Object lastaccesstime -lt (get-date).AddDays(-7) |Remove-Item
}
# Delete the file mercury.db if its size exceeds 100 MB.
If(Test-Path -Path $env:LOCALAPPDATA\Spotify\mercury.db){
$file_mercury = Get-Item "$env:LOCALAPPDATA\Spotify\mercury.db"
if ($file_mercury.length -gt 100MB) {dir $env:LOCALAPPDATA\Spotify\mercury.db -File -Recurse|del}
if ($file_mercury.length -gt 100MB) {Get-ChildItem $env:LOCALAPPDATA\Spotify\mercury.db -File -Recurse | Remove-Item}
}

View File

@@ -1,13 +1,13 @@
# Запускаем Spotify.exe и ждем завершения процесса
Start-Process -FilePath $env:APPDATA\Spotify\Spotify.exe; wait-process -name Spotify
# Этот блок удаляет файлы кэша по времени последнего доступа к нему, тоесть файлы которые не были изменены и не открывались больше указанного вами количества дней, будут удалены. Если нужно заменить на другое значение подствьте своё число в ln 6 col 98 (количество дней = seven)
# Этот блок удаляет файлы кэша по времени последнего доступа к нему, тоесть файлы которые не были изменены и не открывались больше указанного вами количества дней, будут удалены. Если нужно заменить на другое значение подставьте своё значение в 6 строку и 118 столбец (По умолчанию равно 7 дней).
If (Test-Path -Path $env:LOCALAPPDATA\Spotify\Data) {
dir $env:LOCALAPPDATA\Spotify\Data -File -Recurse | ? lastaccesstime -lt (get-date).AddDays(-7) | del
Get-ChildItem $env:LOCALAPPDATA\Spotify\Data -File -Recurse | Where-Object lastaccesstime -lt (get-date).AddDays(-7) | Remove-Item
}
# Удаляем файл mercury.db если его размер привышает 100 MB.
If (Test-Path -Path $env:LOCALAPPDATA\Spotify\mercury.db) {
$file_mercury = Get-Item "$env:LOCALAPPDATA\Spotify\mercury.db"
if ($file_mercury.length -gt 100MB) { dir $env:LOCALAPPDATA\Spotify\mercury.db -File -Recurse | del }
if ($file_mercury.length -gt 100MB) { Get-ChildItem $env:LOCALAPPDATA\Spotify\mercury.db -File -Recurse | Remove-Item }
}