Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions internal/presets/savestats.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ func measureOne(path string, deadline time.Time) (count int, bytes int64, latest
if d.IsDir() {
return nil
}
// Not part of any save (Steam's remotecache.vdf): a folder holding
// only that is a game Steam knows of, not a save, and was tracked as
// one — twenty-odd games with nothing to sync.
if delta.NeverSynced(d.Name()) {
return nil
}
fi, err := d.Info()
if err != nil {
return nil
Expand Down
14 changes: 14 additions & 0 deletions internal/presets/savestats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,3 +211,17 @@ func TestMeasure_FolderHoldingOnlyAJunctionIsEmpty(t *testing.T) {
saves[0].FileCount)
}
}

// A Steam userdata folder holding only Steam's own remotecache.vdf is not a
// save: measured, it is empty, and so it is never offered as a new game.
func TestMeasure_OnlyLauncherFilesIsEmpty(t *testing.T) {
dir := t.TempDir()
if err := os.WriteFile(filepath.Join(dir, "remotecache.vdf"), []byte("steam"), 0o666); err != nil {
t.Fatal(err)
}
saves := []DiscoveredSave{{SavePath: dir}}
Measure(saves)
if !saves[0].IsEmpty() {
t.Errorf("measured %d file(s): a folder of Steam's bookkeeping counts as a save", saves[0].FileCount)
}
}
Loading