feat(saves): restore a save directly from a USB drive on the PS5#167
Open
Twice6804 wants to merge 1 commit into
Open
feat(saves): restore a save directly from a USB drive on the PS5#167Twice6804 wants to merge 1 commit into
Twice6804 wants to merge 1 commit into
Conversation
Mirrors the "Save to USB" feature (83ea617) with a "Restore from USB" action (per-row + bulk) on the Saves screen. Reads the latest timestamped zip from <savePath>/<title_id>/<timestamp>/<title_id>.zip on a USB / extended-storage drive plugged into the PS5, validates and unzips it in a host temp dir, then wipes and re-uploads the live save — no PC round- trip needed. Resolves "latest" by listing the title_id directory and picking the lexically-greatest timestamp folder (the YYYY-MM-DD_HHMMSS format from backupTimestamp() is documented as lexically sortable). Per-row "Restore from USB" confirms with the resolved timestamp before wiping. Bulk "Restore all from USB" confirms once up front; games with no backup on the USB drive are skipped and reported in the summary separately from failures. Reuses all existing backend commands (transfer_download, save_archive_ unzip, save_archive_restore_prepare, fs_list_dir, fs_delete, transfer_dir); no payload/engine changes required. Carries the same stale-host guard as handleRestore to prevent wipes against the wrong console if the user switches PS5 during the operation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Author
|
@phantomptr Added the restore saves from usb functionality requested in #144 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Mirrors the "Save to USB" feature (83ea617) with a Restore from USB action on the Saves screen — both per-row and bulk.
Reads the latest timestamped backup zip from `/<title_id>//<title_id>.zip` on a USB / extended-storage drive plugged into the PS5, validates it in a host temp dir, then wipes and re-uploads the live save — no PC round-trip needed.
Type of Change
Changes Made
Documentation Updates
Did you update the documentation? [x] No
No docs changes needed — the feature is a direct mirror of "Save to USB" which also had no dedicated doc entry.
Testing
Hardware testing checklist (requires a PS5 with USB drive):
No backend/engine changes — all commands reused from the existing restore and backup flows. The stale-host guard (present in `handleRestore` since 2.9.0) is carried over verbatim to prevent wipes against the wrong console if the user switches PS5 during the operation.
Additional Notes
The "latest backup" is resolved by sorting the timestamp directory names as strings — the `YYYY-MM-DD_HHMMSS` format produced by `backupTimestamp()` is documented as lexically sortable, so no mtime parsing is needed.