added game name cache to localstate

This commit is contained in:
2025-11-19 21:35:49 +01:00
parent 8eb8d0b1db
commit ff2cb2335c
2 changed files with 4 additions and 5 deletions

View File

@@ -13,14 +13,15 @@ type AssetState struct {
}
type LocalState struct {
Assets []AssetState
Assets []AssetState
GameIDs map[string]string
}
func loadLocalState(filename string) (*LocalState, error) {
file, err := os.Open(filename)
if err != nil {
if errors.Is(err, os.ErrNotExist) {
return &LocalState{Assets: []AssetState{}}, nil
return &LocalState{Assets: []AssetState{}, GameIDs: map[string]string{}}, nil
}
return nil, err
}