diff --git a/cloudSyncHealth.ps1 b/cloudSyncHealth.ps1 index c6750b88..1776d505 100644 --- a/cloudSyncHealth.ps1 +++ b/cloudSyncHealth.ps1 @@ -37,7 +37,7 @@ function cloud_sync_download_test($emuName){ "test" | Set-Content "$target\.temp" -ErrorAction SilentlyContinue -Encoding UTF8 $fileHash = "$target\.temp" Write-Host "Testing $emuName download..." - & $cloud_sync_bin -q --log-file "$userFolder/EmuDeck/logs/rclone.log" copyto --fast-list --checkers=50 --transfers=50 --low-level-retries 1 --retries 1 "$cloud_sync_provider`:Emudeck\saves\$emuName\.temp" "$fileHash" + & $cloud_sync_bin -q --log-file "$userFolder/EmuDeck/logs/rclone.log" copyto --fast-list --checkers=50 --transfers=50 --low-level-retries 1 --retries 1 "$cloud_sync_provider`:$cs_user`Emudeck\saves\$emuName\.temp" "$fileHash" if ($?) { Write-Host "success" -ForegroundColor Green }else{ @@ -62,7 +62,7 @@ function cloud_sync_upload_test($emuNAme){ Write-Host "Testing $emuName upload..." - & $cloud_sync_bin -q --log-file "$userFolder/EmuDeck/logs/rclone.log" copyto --fast-list --checkers=50 --transfers=50 --low-level-retries 1 --retries 1 "$fileHash" "$cloud_sync_provider`:Emudeck\saves\$emuName\.temp" + & $cloud_sync_bin -q --log-file "$userFolder/EmuDeck/logs/rclone.log" copyto --fast-list --checkers=50 --transfers=50 --low-level-retries 1 --retries 1 "$fileHash" "$cloud_sync_provider`:$cs_user`Emudeck\saves\$emuName\.temp" if ($?) { Write-Host "success" -ForegroundColor Green }else{ diff --git a/functions/JSONtoPS1.ps1 b/functions/JSONtoPS1.ps1 index 43046c96..c63d993f 100644 --- a/functions/JSONtoPS1.ps1 +++ b/functions/JSONtoPS1.ps1 @@ -12,7 +12,7 @@ function storePatreonToken($token){ mkdir "$savesPath" -ErrorAction SilentlyContinue $token | Set-Content -Path "$savesPath/.token" -Encoding UTF8 if (Test-Path "$cloud_sync_bin") { - & $cloud_sync_bin --progress copyto --fast-list --checkers=50 --transfers=50 --low-level-retries 1 --retries 1 "$savesPath/.token" "$cloud_sync_provider`:Emudeck\saves\.token" + & $cloud_sync_bin --progress copyto --fast-list --checkers=50 --transfers=50 --low-level-retries 1 --retries 1 "$savesPath/.token" "$cloud_sync_provider`:$cs_user`Emudeck\saves\.token" } } diff --git a/functions/ToolScripts/emuDeckSaveSync.ps1 b/functions/ToolScripts/emuDeckSaveSync.ps1 index 9fbaecbc..8c06d7de 100644 --- a/functions/ToolScripts/emuDeckSaveSync.ps1 +++ b/functions/ToolScripts/emuDeckSaveSync.ps1 @@ -235,8 +235,8 @@ function cloud_sync_config($cloud_sync_provider, $token){ Start-Process $cloud_sync_bin -ArgumentList @" config update $cloud_sync_provider "@ -WindowStyle Maximized -Wait - & $cloud_sync_bin mkdir "$cloud_sync_provider`:Emudeck\saves" - & $cloud_sync_bin copy $savesPath "$cloud_sync_provider`:Emudeck\saves" --include "*.cloud" + & $cloud_sync_bin mkdir "$cloud_sync_provider`:$cs_user`Emudeck\saves" + & $cloud_sync_bin copy $savesPath "$cloud_sync_provider`:$cs_user`Emudeck\saves" --include "*.cloud" #Cleaning up Get-ChildItem -Path $carpetaLocal -Filter "*.cloud" | ForEach-Object { Remove-Item $_.FullName @@ -253,8 +253,8 @@ function cloud_sync_config($cloud_sync_provider, $token){ Start-Process $cloud_sync_bin -ArgumentList @" config update "Emudeck-SFTP" host=$($credentials.Url) user=$($credentials.Username) port=$($credentials.Port) pass="$obscuredPassword" "@ -WindowStyle Maximized -Wait - & $cloud_sync_bin mkdir "$cloud_sync_provider`:Emudeck\saves" - & $cloud_sync_bin copy $savesPath "$cloud_sync_provider`:Emudeck\saves" --include "*.cloud" + & $cloud_sync_bin mkdir "$cloud_sync_provider`:$cs_user`Emudeck\saves" + & $cloud_sync_bin copy $savesPath "$cloud_sync_provider`:$cs_user`Emudeck\saves" --include "*.cloud" #Cleaning up Get-ChildItem -Path $carpetaLocal -Filter "*.cloud" | ForEach-Object { Remove-Item $_.FullName @@ -277,8 +277,8 @@ function cloud_sync_config($cloud_sync_provider, $token){ Start-Process $cloud_sync_bin -ArgumentList @" config update "Emudeck-cloud" host="cloud.emudeck.com" user="cs_$user" port="22" pass="$pass" "@ -WindowStyle Maximized -Wait - & $cloud_sync_bin mkdir "$cloud_sync_provider`:Emudeck\saves" - & $cloud_sync_bin copy $savesPath "$cloud_sync_provider`:Emudeck\saves" --include "*.cloud" + & $cloud_sync_bin mkdir "$cloud_sync_provider`:$cs_user`Emudeck\saves" + & $cloud_sync_bin copy $savesPath "$cloud_sync_provider`:$cs_user`Emudeck\saves" --include "*.cloud" #Cleaning up Get-ChildItem -Path $carpetaLocal -Filter "*.cloud" | ForEach-Object { Remove-Item $_.FullName @@ -298,8 +298,8 @@ function cloud_sync_config($cloud_sync_provider, $token){ createCloudFile $_.FullName } - & $cloud_sync_bin mkdir "$cloud_sync_provider`:Emudeck\saves" - & $cloud_sync_bin copy $savesPath "$cloud_sync_provider`:Emudeck\saves" --include "*.cloud" + & $cloud_sync_bin mkdir "$cloud_sync_provider`:$cs_user`Emudeck\saves" + & $cloud_sync_bin copy $savesPath "$cloud_sync_provider`:$cs_user`Emudeck\saves" --include "*.cloud" #Cleaning up Get-ChildItem -Path $carpetaLocal -Filter "*.cloud" | ForEach-Object { Remove-Item $_.FullName @@ -426,7 +426,7 @@ function cloud_sync_download($emuName){ if ((Test-Path "$cloud_sync_bin") -and ($cloud_sync_status -eq $true)) { - & "$cloud_sync_bin" --progress copyto -L --fast-list --checkers=50 --transfers=50 --low-level-retries 1 --retries 1 --log-file "$userFolder/EmuDeck/logs/rclone.log" "$cloud_sync_provider`:Emudeck/saves/.token" "$savesPath/.token" + & "$cloud_sync_bin" --progress copyto -L --fast-list --checkers=50 --transfers=50 --low-level-retries 1 --retries 1 --log-file "$userFolder/EmuDeck/logs/rclone.log" "$cloud_sync_provider`:$cs_user`Emudeck/saves/.token" "$savesPath/.token" $tokenPath = "$savesPath/.token" if (Test-Path $tokenPath) { @@ -470,7 +470,7 @@ function cloud_sync_download($emuName){ $hash="0" } - & $cloud_sync_bin --progress copyto --fast-list --checkers=50 --transfers=50 --low-level-retries 1 --retries 1 --log-file "$userFolder/EmuDeck/logs/rclone.log" "$cloud_sync_provider`:Emudeck\saves\.hash" "$fileHash" + & $cloud_sync_bin --progress copyto --fast-list --checkers=50 --transfers=50 --low-level-retries 1 --retries 1 --log-file "$userFolder/EmuDeck/logs/rclone.log" "$cloud_sync_provider`:$cs_user`Emudeck\saves\.hash" "$fileHash" if (Test-Path -PathType Any "$fileHash"){ $hashCloud= Get-Content $fileHash @@ -482,7 +482,7 @@ function cloud_sync_download($emuName){ $dialog = steamToast -MessageText "Saves up to date, no need to sync" }else{ $dialog = steamToast -MessageText "Downloading saves for all installed system, please wait..." - & $cloud_sync_bin copy --fast-list --update --checkers=50 --exclude=/.fail_upload --exclude=/.fail_download --exclude=/system/prod.keys --exclude=/system/title.keys --exclude=/.pending_upload --exclude=/.watching --exclude=/*.lnk --exclude=/.cloud --exclude=/.emulator -q --log-file "$userFolder/EmuDeck/logs/rclone.log" --exclude=/.user "$cloud_sync_provider`:Emudeck\saves\" "$target" + & $cloud_sync_bin copy --fast-list --update --checkers=50 --exclude=/.fail_upload --exclude=/.fail_download --exclude=/system/prod.keys --exclude=/system/title.keys --exclude=/.pending_upload --exclude=/.watching --exclude=/*.lnk --exclude=/.cloud --exclude=/.emulator -q --log-file "$userFolder/EmuDeck/logs/rclone.log" --exclude=/.user "$cloud_sync_provider`:$cs_user`Emudeck\saves\" "$target" if ($?) { $baseFolder = "$target" $timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss" @@ -501,7 +501,7 @@ function cloud_sync_download($emuName){ } }else{ $dialog = steamToast -MessageText "Downloading saves for all installed system, please wait..." - & $cloud_sync_bin copy --update --fast-list --checkers=50 --exclude=/.fail_upload --exclude=/.fail_download --exclude=/system/prod.keys --exclude=/system/title.keys --exclude=/.pending_upload --exclude=/.watching --exclude=/*.lnk --exclude=/.cloud --exclude=/.emulator --exclude=/.user --log-file "$userFolder/EmuDeck/logs/rclone.log" "$cloud_sync_provider`:Emudeck\saves\" "$target" + & $cloud_sync_bin copy --update --fast-list --checkers=50 --exclude=/.fail_upload --exclude=/.fail_download --exclude=/system/prod.keys --exclude=/system/title.keys --exclude=/.pending_upload --exclude=/.watching --exclude=/*.lnk --exclude=/.cloud --exclude=/.emulator --exclude=/.user --log-file "$userFolder/EmuDeck/logs/rclone.log" "$cloud_sync_provider`:$cs_user`Emudeck\saves\" "$target" if ($?) { $baseFolder = "$target" $timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss" @@ -530,7 +530,7 @@ function cloud_sync_download($emuName){ $hash="0" } - & $cloud_sync_bin -q --log-file "$userFolder/EmuDeck/logs/rclone.log" copyto --fast-list --checkers=50 --transfers=50 --low-level-retries 1 --retries 1 --log-file "$userFolder/EmuDeck/logs/rclone.log" "$cloud_sync_provider`:Emudeck\saves\$emuName\.hash" "$fileHash" + & $cloud_sync_bin -q --log-file "$userFolder/EmuDeck/logs/rclone.log" copyto --fast-list --checkers=50 --transfers=50 --low-level-retries 1 --retries 1 --log-file "$userFolder/EmuDeck/logs/rclone.log" "$cloud_sync_provider`:$cs_user`Emudeck\saves\$emuName\.hash" "$fileHash" if (Test-Path -PathType Any "$fileHash"){ $hashCloud= Get-Content $fileHash @@ -542,11 +542,11 @@ function cloud_sync_download($emuName){ $dialog = steamToast -MessageText "Saves up to date, no need to sync" }else{ $dialog = steamToast -MessageText "Downloading saves for $emuName, please wait..." - & $cloud_sync_bin copy --fast-list --update --tpslimit 12 --checkers=50 --exclude=/.fail_upload --exclude=/.fail_download --exclude=/system/prod.keys --exclude=/system/title.keys --exclude=/.pending_upload --exclude=/.watching --exclude=/*.lnk --exclude=/.cloud --exclude=/.emulator -q --log-file "$userFolder/EmuDeck/logs/rclone.log" --exclude=/.user "$cloud_sync_provider`:Emudeck\saves\$emuName\" "$target" + & $cloud_sync_bin copy --fast-list --update --tpslimit 12 --checkers=50 --exclude=/.fail_upload --exclude=/.fail_download --exclude=/system/prod.keys --exclude=/system/title.keys --exclude=/.pending_upload --exclude=/.watching --exclude=/*.lnk --exclude=/.cloud --exclude=/.emulator -q --log-file "$userFolder/EmuDeck/logs/rclone.log" --exclude=/.user "$cloud_sync_provider`:$cs_user`Emudeck\saves\$emuName\" "$target" } }else{ $dialog = steamToast -MessageText "Downloading saves for $emuName, please wait..." - & $cloud_sync_bin copy --fast-list --update --tpslimit 12 --checkers=50 --exclude=/.fail_upload --exclude=/.fail_download --exclude=/system/prod.keys --exclude=/system/title.keys --exclude=/.pending_upload --exclude=/.watching --exclude=/*.lnk --exclude=/.cloud --exclude=/.emulator -q --log-file "$userFolder/EmuDeck/logs/rclone.log" --exclude=/.user "$cloud_sync_provider`:Emudeck\saves\$emuName\" "$target" + & $cloud_sync_bin copy --fast-list --update --tpslimit 12 --checkers=50 --exclude=/.fail_upload --exclude=/.fail_download --exclude=/system/prod.keys --exclude=/system/title.keys --exclude=/.pending_upload --exclude=/.watching --exclude=/*.lnk --exclude=/.cloud --exclude=/.emulator -q --log-file "$userFolder/EmuDeck/logs/rclone.log" --exclude=/.user "$cloud_sync_provider`:$cs_user`Emudeck\saves\$emuName\" "$target" } } @@ -605,7 +605,7 @@ function cloud_sync_upload{ cloud_sync_save_hash($target) - & $cloud_sync_bin copy --fast-list --update --tpslimit 12 --checkers=50 --exclude=/.fail_upload --exclude=/.fail_download --exclude=/system/prod.keys --exclude=/system/title.keys --exclude=/.pending_upload --exclude=/.watching --exclude=/*.lnk --exclude=/.cloud --exclude=/.emulator --exclude=/.user -q --log-file "$userFolder/EmuDeck/logs/rclone.log" "$target" "$cloud_sync_provider`:Emudeck\saves\" + & $cloud_sync_bin copy --fast-list --update --tpslimit 12 --checkers=50 --exclude=/.fail_upload --exclude=/.fail_download --exclude=/system/prod.keys --exclude=/system/title.keys --exclude=/.pending_upload --exclude=/.watching --exclude=/*.lnk --exclude=/.cloud --exclude=/.emulator --exclude=/.user -q --log-file "$userFolder/EmuDeck/logs/rclone.log" "$target" "$cloud_sync_provider`:$cs_user`Emudeck\saves\" if ($?) { $baseFolder = "$target" $timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss" @@ -626,7 +626,7 @@ function cloud_sync_upload{ $target = "$emulationPath\saves\$emuName" cloud_sync_save_hash($target) - & $cloud_sync_bin copy -q --log-file "$userFolder/EmuDeck/logs/rclone.log" --fast-list --update --tpslimit 12 --checkers=50 --exclude=/.fail_upload --exclude=/.fail_download --exclude=/system/prod.keys --exclude=/system/title.keys --exclude=/.pending_upload --exclude=/.watching --exclude=/*.lnk --exclude=/.cloud --exclude=/.emulator --exclude=/.user --log-file "$userFolder/EmuDeck/logs/rclone.log" "$target" "$cloud_sync_provider`:Emudeck\saves\$emuName\" + & $cloud_sync_bin copy -q --log-file "$userFolder/EmuDeck/logs/rclone.log" --fast-list --update --tpslimit 12 --checkers=50 --exclude=/.fail_upload --exclude=/.fail_download --exclude=/system/prod.keys --exclude=/system/title.keys --exclude=/.pending_upload --exclude=/.watching --exclude=/*.lnk --exclude=/.cloud --exclude=/.emulator --exclude=/.user --log-file "$userFolder/EmuDeck/logs/rclone.log" "$target" "$cloud_sync_provider`:$cs_user`Emudeck\saves\$emuName\" if ($?) { Write-Host "upload success" Write-Host $target diff --git a/functions/cloudSyncHealth.ps1 b/functions/cloudSyncHealth.ps1 index 6b5e4c8b..a9d7bc39 100644 --- a/functions/cloudSyncHealth.ps1 +++ b/functions/cloudSyncHealth.ps1 @@ -42,7 +42,7 @@ function cloudSyncHealth(){ Start-Sleep -Seconds 1 } - $result = & $cloud_sync_bin lsf "$cloud_sync_provider`:Emudeck/saves/retroarch/" | Select-String "test_emudeck.txt" + $result = & $cloud_sync_bin lsf "$cloud_sync_provider`:$cs_user`Emudeck/saves/retroarch/" | Select-String "test_emudeck.txt" # Evaluar el resultado if ($result) { @@ -57,7 +57,7 @@ function cloudSyncHealth(){ ##Testing Dowmload # - & "$cloud_sync_bin" --progress copyto -L --fast-list --checkers=50 --transfers=50 --low-level-retries 1 --retries 1 "$cloud_sync_provider`:Emudeck/saves/retroarch/test_emudeck.txt" "$savesPath/retroarch/test_emudeck.txt" + & "$cloud_sync_bin" --progress copyto -L --fast-list --checkers=50 --transfers=50 --low-level-retries 1 --retries 1 "$cloud_sync_provider`:$cs_user`Emudeck/saves/retroarch/test_emudeck.txt" "$savesPath/retroarch/test_emudeck.txt" if (Test-Path "$savesPath\retroarch\test_emudeck.txt") { Write-Host "file exists in local. SUCCESS" @@ -71,7 +71,7 @@ function cloudSyncHealth(){ Remove-Item -Recurse -Force "$savesPath\retroarch\test_emudeck.txt" # Eliminar el archivo remoto - & $cloud_sync_bin delete "$cloud_sync_provider`:Emudeck/saves/retroarch/test_emudeck.txt" + & $cloud_sync_bin delete "$cloud_sync_provider`:$cs_user`Emudeck/saves/retroarch/test_emudeck.txt" # Verificar si se debe matar Retroarch o cerrar otra ventana if ($kill -eq "RETROARCH") { diff --git a/functions/helperFunctions.ps1 b/functions/helperFunctions.ps1 index d3f60efd..18d786c4 100644 --- a/functions/helperFunctions.ps1 +++ b/functions/helperFunctions.ps1 @@ -1304,7 +1304,7 @@ function storePatreonToken($token){ mkdir "$savesPath" -ErrorAction SilentlyContinue $token | Set-Content -Path "$savesPath/.token" -Encoding UTF8 if (Test-Path "$cloud_sync_bin") { - & $cloud_sync_bin --progress copyto --fast-list --checkers=50 --transfers=50 --low-level-retries 1 --retries 1 "$savesPath/.token" "$cloud_sync_provider`:Emudeck\saves\.token" + & $cloud_sync_bin --progress copyto --fast-list --checkers=50 --transfers=50 --low-level-retries 1 --retries 1 "$savesPath/.token" "$cloud_sync_provider`:$cs_user`Emudeck\saves\.token" }else{ echo "NOPE" }