tracker

package
v2.17.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2026 License: GPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
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

func ResolvePath(path string) string

Convert a launchable path to an absolute path.

func RunArcadeHistoryBackfill added in v2.17.0

func RunArcadeHistoryBackfill(ctx context.Context, db *database.Database, tr *Tracker)

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.

func StartFileWatch

func StartFileWatch(tr *Tracker) (*fsnotify.Watcher, error)

StartFileWatch Start thread for monitoring changes to all files relating to core/game launches.

Types

type NameMapping

type NameMapping struct {
	CoreName   string
	System     string
	Name       string
	ArcadeName string
}

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 NewTracker(
	ctx context.Context,
	pl platforms.Platform,
	cfg *config.Instance,
	activeMedia func() *models.ActiveMedia,
	setActiveMedia func(*models.ActiveMedia),
	db *database.Database,
) (*Tracker, error)

func StartTracker

func StartTracker(
	ctx context.Context,
	cfg *config.Instance,
	pl platforms.Platform,
	activeMedia func() *models.ActiveMedia,
	setActiveMedia func(*models.ActiveMedia),
	db *database.Database,
) (*Tracker, func() error, error)

func (*Tracker) ClearActiveGame added in v2.17.0

func (tr *Tracker) ClearActiveGame() error

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).

func (*Tracker) StopAll

func (tr *Tracker) StopAll()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL