37 Commits

Author SHA1 Message Date
pawndev a8dd4153d2 feat(save): psp save all dirs related to game in a zip
This was the really fun part. No consistency with the other cfw.
All of that mess for just one emulator... For those who come after, I'm really sorry
2026-04-14 22:02:39 +02:00
Brandon T. Kowalski 2d3be85c28 fix: set IsDirectorySave flag on download path
The flag was only set during local scan. Downloads for directory save
platforms (PSP) need the flag set to trigger unzip instead of writing
a raw file.
2026-03-28 16:08:52 -04:00
Brandon T. Kowalski 06a7a4fb52 fix: strip trademark and other special characters from SFO titles
Publishers embed ™, ©, ® etc. in PARAM.SFO titles but ROM filenames
in RomM don't have them. cleanTitle keeps letters, digits, spaces,
and common punctuation, stripping everything else.
2026-03-28 15:40:16 -04:00
Brandon T. Kowalski c08ec86cbe feat: replace GameDB with PARAM.SFO parser for PSP save title resolution
Parse the PARAM.SFO binary file inside each PPSSPP save directory to
extract the game title directly. This eliminates the need for the 339KB
embedded GameDB since the save metadata is already on the device. Tested
with Bust A Move Deluxe and Field Commander SFO files.
2026-03-28 15:37:33 -04:00
Brandon T. Kowalski 6588fbfeef fix: handle PPSSPP save folders with appended slot numbers
Save folders like ULUS10088010000 have the save slot appended directly
without a separator. Try the 9-char Game ID prefix (standard format:
4 letters + 5 digits) in addition to underscore splitting.
2026-03-28 14:54:00 -04:00
Brandon T. Kowalski c4e52aa578 feat: PSP directory save sync with zip upload/download
Add support for PPSSPP directory-based saves. The scan detects save
folders by Game ID, resolves titles via the embedded PSP GameDB, and
matches against the ROM cache by name. Uploads zip the directory,
downloads extract it. Adds GetRomByNameLookup to the cache layer and
ZipDirectory/UnzipToDirectory helpers.
2026-03-28 14:46:27 -04:00
Brandon T. Kowalski 0484896311 feat: embed PSP Game ID database for save folder resolution
Embed a slim 339KB mapping of 7,902 PSP serial numbers to game titles
from niemasd/GameDB-PSP. LookupPSPTitle resolves PPSSPP save folder
names (e.g., UCUS98662_GameData0) to game titles (LocoRoco) by
stripping suffixes and normalizing dashes.
2026-03-28 14:35:41 -04:00
Brandon T. Kowalski fa1aabc0b4 feat: add directory-based save platform registry for PSP
PPSSPP stores saves as Game ID folders (e.g., UCUS98662_GameData0/)
rather than flat files. This registry identifies platforms that need
directory zipping for upload and Game ID resolution for ROM matching.
2026-03-28 14:22:19 -04:00
Brandon T. Kowalski 6543848b7f fix: if backup happy path fails, cancel the sync 2026-03-14 23:30:05 -04:00
Brandon T. Kowalski 4477ed119d Create conflict tester tool and fix more greptile issues 2026-03-04 23:19:17 -05:00
Brandon T. Kowalski 8ffd2dd1b2 Fix code smells 2026-03-04 21:54:09 -05:00
Brandon T. Kowalski a8d856d0f3 Initial work on user configured save slot 2026-03-04 21:30:44 -05:00
Brandon T. Kowalski e22b2a1129 Add backup retention, concurrency, health check, last sync time, and cleanup dead code
- Add concurrent fetching (8 workers) for FetchRemoteSaves and DiscoverRemoteSaves
- Guard against empty emulator string on upload
- Add backup retention setting (5/10/15/No Limit) with cleanup logic
- Show last synced relative time in sync menu
- Add health check before starting save sync
- Remove unused API methods (TrackSave, UntrackSave, GetSaveIdentifiers)
- Remove dead ScreenSaveConflict router registration
- Set with_filter_values and with_char_index to false on ROM queries
- Add missing i18n keys to all locale files
2026-03-01 19:42:44 -05:00
Brandon T. Kowalski 711c7e2a0b Propagate network errors during save sync resolve
Previously, FetchRemoteSaves and DiscoverRemoteSaves silently
continued on HTTP failures, causing local saves to appear as
new uploads and potentially overwriting newer remote data.
Now errors are propagated and the UI shows a connection error
instead of proceeding with a misleading sync.

Closes #144
2026-03-01 16:02:10 -05:00
Brandon T. Kowalski 5b18236811 Add valid save file extensions for broader emulator support 2026-03-01 15:47:04 -05:00
Brandon T. Kowalski 12d387cfdd Add sync engine and ROM scanning
- sync/models.go: action types and sync plan models
- sync/flow.go: core sync flow with conflict detection
- sync/flow_test.go: tests for sync action determination
- sync/roms.go: rewrite to resolve local ROMs against cache
- cfw/roms.go: local ROM filesystem scanning (moved from sync)
- cfw/saves.go: add GetSaveDirectory helper
- tools/save-sync-dry-run/: dry-run testing tool
2026-02-22 12:16:21 -05:00
Brandon T. Kowalski 07ff034b73 Nuke all existing save functionality. I don't want to retrofit this 2026-02-14 21:35:00 -05:00
Brandon T. Kowalski 781af28c27 Remove Auto Sync (will reintroduce as a daemon at a later date) 2026-02-14 01:40:09 -05:00
Brandon T. Kowalski 9d2ed47873 Add missing NDS .dsv save file extension 2026-01-27 01:54:11 -05:00
Brandon T. Kowalski a196bebd4e Fix for save sync timezone comparison #98 2026-01-27 01:18:14 -05:00
Brandon T. Kowalski d307b63f24 Fix ROCKNIX save sync 2026-01-27 00:00:35 -05:00
Brandon T. Kowalski 85e2f92164 Cleanup unused code after refactor 2026-01-21 00:10:11 -05:00
Brandon T. Kowalski 2dee138f0b fix: add reverse mapping for local platforms to RomM slugs along with brute force matching to potentially fix #51 2026-01-14 23:29:19 -05:00
Brandon T. Kowalski cd8c673cdb Have unmatched syncs trigger the cloud alert icon. 2026-01-12 22:26:33 -05:00
Brandon T. Kowalski e4a5d024b6 Remove one last unneeded log 2026-01-12 22:10:45 -05:00
Brandon T. Kowalski 09b0111b44 Consolidated and added more detailed logging for everything attempted in a save sync 2026-01-12 22:08:45 -05:00
Brandon T. Kowalski 1fee652e69 Yet another potential fix for #27 and #51
Makes use of the /api/config endpoint to find if there are any `PLATFORMS_BINDING` from folder aliases
2026-01-12 00:14:42 -05:00
Brandon T. Kowalski 87a870dbda Fuzzy match now uses prefix match similarity alongside Levenshtein Distance taking the max and looking for 80% 2026-01-11 19:18:41 -05:00
Brandon T. Kowalski c0bdaa23f2 Add fuzzy matching confirmation feature as third option after exact match and hash match 2026-01-11 18:41:38 -05:00
Brandon T. Kowalski b92b7da519 Start of orphan matching work 2026-01-11 01:30:18 -05:00
Brandon T. Kowalski 29abba1a71 Grout now properly detected "orphaned" ROMS / Saves and "reattaches" them with a CRC32 lookup.
This will allow for duplicate roms on a local device (e.g. Pokemon Red.gb and Pokemon Red Nuzlocke.gb) and for the saves to be synced and managed separately
2026-01-10 17:02:09 -05:00
Brandon T. Kowalski 21e52edd00 Start of work for #57 2026-01-10 01:52:03 -05:00
Brandon T. Kowalski fb4a027e66 Caching work and fixing save sync 2026-01-06 18:53:43 -05:00
Brandon T. Kowalski f522980f55 Rework caching to be more efficient and be backed by SQLite. 2026-01-06 02:12:12 -05:00
Brandon T. Kowalski 4ca19c38c9 More reorg and fixing the multiple platform versions mapping 2026-01-04 15:19:28 -05:00
Brandon T. Kowalski 56982c45ea More breaking up of the massive utils package. Almost organized! 2026-01-04 11:51:47 -05:00
Brandon T. Kowalski fc23056f09 Mid-mass refactor to get everything into a respectable package structure 2026-01-04 01:47:01 -05:00