Skip to content

Commit

Permalink
fix app game display bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
wizzomafizzo committed Jul 9, 2024
1 parent 3a14232 commit 8f88557
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
8 changes: 7 additions & 1 deletion pkg/daemon/api/games.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/go-chi/render"
"github.com/rs/zerolog/log"
"github.com/wizzomafizzo/tapto/pkg/assets"
"github.com/wizzomafizzo/tapto/pkg/config"
"github.com/wizzomafizzo/tapto/pkg/database/gamesdb"
"github.com/wizzomafizzo/tapto/pkg/platforms"
Expand Down Expand Up @@ -64,7 +65,12 @@ func (s *Index) GenerateIndex(platform platforms.Platform, cfg *config.UserConfi
if err != nil {
s.CurrentDesc = status.SystemId
} else {
s.CurrentDesc = system.Id
md, err := assets.GetSystemMetadata(system.Id)
if err != nil {
s.CurrentDesc = system.Id
} else {
s.CurrentDesc = md.Name
}
}
}
log.Info().Msgf("indexing status: %s", s.CurrentDesc)
Expand Down
7 changes: 5 additions & 2 deletions pkg/platforms/mister/tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,8 @@ func (tr *Tracker) LoadCore() {

result := tr.LookupCoreName(coreName, tr.ActiveGamePath)
if result != (NameMapping{}) {
mister.SetActiveGame(result.CoreName)

if result.ArcadeName != "" {
mister.SetActiveGame(result.CoreName)
tr.ActiveGameId = coreName
tr.ActiveGameName = result.ArcadeName
tr.ActiveGamePath = "" // TODO: any way to find this?
Expand Down Expand Up @@ -242,6 +241,10 @@ func (tr *Tracker) loadGame() {
log.Error().Msgf("error getting active game: %s", err)
tr.stopGame()
return
} else if !filepath.IsAbs(activeGame) {
// arcade game, ignore handling
// TODO: will this work ok long term?
return
} else if activeGame == "" {
tr.stopGame()
return
Expand Down

0 comments on commit 8f88557

Please sign in to comment.