diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8f9ced8f..b7a9d4ec 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -235,6 +235,17 @@ jobs: cp opensave-decky-plugin/package.json decky-pkg/OpenSave/ cp opensave-decky-plugin/main.py decky-pkg/OpenSave/ cp opensave-decky-plugin/dist/index.js decky-pkg/OpenSave/dist/ + # The zip says the version of the tag it is released under. Plugin + # managers compare the two, and a mismatch offers the same update + # again and again (#149). A manual run has no tag: it keeps the files'. + if [ "$GITHUB_REF_TYPE" = "tag" ]; then + V="${GITHUB_REF_NAME#v}" + for f in plugin.json package.json; do + jq --arg v "$V" '.version = $v' "decky-pkg/OpenSave/$f" > "$f.stamped" + mv "$f.stamped" "decky-pkg/OpenSave/$f" + test "$(jq -r .version "decky-pkg/OpenSave/$f")" = "$V" + done + fi (cd decky-pkg && zip -r ../OpenSave-decky-plugin.zip OpenSave) unzip -l OpenSave-decky-plugin.zip diff --git a/internal/presets/presets.go b/internal/presets/presets.go index b11f6d50..93729a6e 100644 --- a/internal/presets/presets.go +++ b/internal/presets/presets.go @@ -87,7 +87,7 @@ var presetDefs = []preset{ LinuxPath: []string{"~/.config/PCSX2/memcards", "~/.var/app/net.pcsx2.PCSX2/config/PCSX2/memcards"}}, {ID: "rpcs3", Name: "RPCS3 PS3 Emulator", Type: "emulator", Path: "%APPDATA%/rpcs3/dev_hdd0/home/00000001/savedata", LinuxPath: []string{"~/.config/rpcs3/dev_hdd0/home/00000001/savedata", "~/.var/app/net.rpcs3.RPCS3/config/rpcs3/dev_hdd0/home/00000001/savedata"}}, - {ID: "cemu", Name: "Cemu Wii U Emulator", Type: "emulator", Path: "%USERPROFILE%/Documents/Cemu/mlc01/usr/save", + {ID: "cemu", Name: "Cemu Wii U Emulator", Type: "emulator", Path: "%APPDATA%/Cemu/mlc01/usr/save", LinuxPath: []string{"~/.local/share/Cemu/mlc01/usr/save", "~/.var/app/info.cemu.Cemu/data/Cemu/mlc01/usr/save"}}, {ID: "ppsspp", Name: "PPSSPP PSP Emulator", Type: "emulator", Path: "%USERPROFILE%/Documents/PPSSPP/PSP/SAVEDATA", LinuxPath: []string{"~/.config/ppsspp/PSP/SAVEDATA", "~/.var/app/org.ppsspp.PPSSPP/config/ppsspp/PSP/SAVEDATA"}}, diff --git a/internal/presets/retro_emulators_test.go b/internal/presets/retro_emulators_test.go index 0ad6e0f1..a45ba35d 100644 --- a/internal/presets/retro_emulators_test.go +++ b/internal/presets/retro_emulators_test.go @@ -30,6 +30,7 @@ func TestRetroEmulatorPresetsResolveOnLinux(t *testing.T) { "fceux": ".fceux/sav", "mesen": ".local/share/Mesen2/Saves", "blastem": ".local/share/blastem", + "cemu": ".local/share/Cemu/mlc01/usr/save", } for id, rel := range cases { @@ -54,14 +55,29 @@ func TestRetroEmulatorPresetsResolveOnLinux(t *testing.T) { } } +// Cemu's own default on Windows is %APPDATA%\Cemu\mlc01 (CemuApp::DeterminePaths, +// ActiveSettings::GetDefaultMLCPath). The preset named Documents\Cemu, a folder +// Cemu never picks, so a default install was not found at all. +func TestCemuWindowsPathIsCemusDefault(t *testing.T) { + for _, p := range presetDefs { + if p.ID == "cemu" { + if want := "%APPDATA%/Cemu/mlc01/usr/save"; p.Path != want { + t.Errorf("cemu Windows path = %q, want %q", p.Path, want) + } + return + } + } + t.Fatal("no cemu preset") +} + // Every preset must carry a Linux path unless the emulator genuinely is -// Windows-only. A Windows-only entry is a real choice (Cemu, Xenia, Project64); +// Windows-only. A Windows-only entry is a real choice (Xenia, Project64); // an accidentally Windows-only one silently excludes every Deck user, which is // the audience most likely to be running these. func TestRetroEmulatorPresetsCoverLinuxExceptWindowsOnlyOnes(t *testing.T) { // Emulators with no Linux build worth detecting. windowsOnly := map[string]bool{ - "xenia": true, "cemu": true, "project64": true, + "xenia": true, "project64": true, } for _, p := range presetDefs {