Documentation
¶
Index ¶
- Constants
- func ResolveArcadeSetName(ctx context.Context, mediaDB database.MediaDBI, setName, arcadeName string) (path string, ok bool)
- func ResolvePath(path string) string
- func RunArcadeHistoryBackfill(ctx context.Context, db *database.Database, tr *Tracker)
- func StartFileWatch(tr *Tracker) (*fsnotify.Watcher, error)
- type NameMapping
- type Tracker
- func (tr *Tracker) ClearActiveGame() error
- func (tr *Tracker) LoadCore()
- func (tr *Tracker) LookupCoreName(name string) *NameMapping
- func (tr *Tracker) ReloadNameMap()
- func (tr *Tracker) ResolveExternalMediaPath(ctx context.Context, systemID, value string) (string, bool)
- func (tr *Tracker) StopAll()
Constants ¶
const (
ArcadeSystem = "Arcade"
)
Variables ¶
This section is empty.
Functions ¶
func ResolveArcadeSetName ¶ added in v2.17.0
func ResolveArcadeSetName( ctx context.Context, mediaDB database.MediaDBI, setName, arcadeName string, ) (path string, ok bool)
ResolveArcadeSetName maps a MiSTer arcade core's set name (as reported by /tmp/CORENAME) to the single indexed .mra file that owns it. arcadeName is the pretty name from ArcadeDatabase.csv, used to narrow the MediaDB search before each candidate is confirmed by parsing its own <setname>. Ambiguous or unconfirmable set names report ok=false rather than guessing - callers keep today's set-name-only behaviour in that case.
func ResolvePath ¶
Convert a launchable path to an absolute path.
func RunArcadeHistoryBackfill ¶ added in v2.17.0
RunArcadeHistoryBackfill resolves every legacy MediaHistory row recorded under a bare arcade set name (MediaPath = "pooyan", not a path - from a launch the tracker detected externally, before ResolveArcadeSetName existed) to its canonical .mra path and identity, then never runs again. Intended to run once as an idle-scheduler task for the life of the platform; blocks until fully done or ctx is cancelled.
Types ¶
type NameMapping ¶
type Tracker ¶
type Tracker struct {
ActiveSystemName string
ActiveSystem string
ActiveGameID string
ActiveGameName string
ActiveGamePath string
ActiveCore string
NameMap []NameMapping
// contains filtered or unexported fields
}
func NewTracker ¶
func StartTracker ¶
func (*Tracker) ClearActiveGame ¶ added in v2.17.0
ClearActiveGame synchronously retires tracker state and clears the shared ACTIVEGAME signal so a bare core or menu transition cannot inherit it.
func (*Tracker) LoadCore ¶
func (tr *Tracker) LoadCore()
LoadCore loads the current running core and set it as active.
func (*Tracker) LookupCoreName ¶
func (tr *Tracker) LookupCoreName(name string) *NameMapping
func (*Tracker) ReloadNameMap ¶
func (tr *Tracker) ReloadNameMap()
func (*Tracker) ResolveExternalMediaPath ¶ added in v2.17.0
func (tr *Tracker) ResolveExternalMediaPath(ctx context.Context, systemID, value string) (string, bool)
ResolveExternalMediaPath maps a legacy MediaHistory row's set-name-only MediaPath back to its canonical indexed .mra path, for the arcade history backfill task (arcade_history_backfill.go).