gamelistxml

package
v2.15.1 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Overview

Package gamelistxml implements a scraper that reads EmulationStation gamelist.xml files to enrich the Zaparoo MediaDB with developer, publisher, genre, rating, year, artwork paths, and descriptions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPlatformScraper

func NewPlatformScraper() platforms.Scraper

NewPlatformScraper returns a platforms.Scraper backed by EmulationStation gamelist.xml files. Systems are resolved at scrape time from the platform and media database; no state is captured at construction.

Types

type GamelistRecord

type GamelistRecord struct {
	MediaDirsByRoot     []map[string]string
	SystemRootPath      string
	MatchKind           gamelistMatchKind
	Game                esapi.Game
	MatchedMediaDBID    int64
	MatchedTitleDBID    int64
	MediaLevelWriteSafe bool
}

GamelistRecord is one matched gamelist.xml entry, bundled with the filesystem root path and the DB identifiers of the matched MediaTitle and one of its Media rows (used as the sentinel write target).

type GamelistXMLScraper

type GamelistXMLScraper struct {
	// contains filtered or unexported fields
}

GamelistXMLScraper loads and maps EmulationStation gamelist.xml records. Use NewPlatformScraper to obtain a configured platforms.Scraper.

func (*GamelistXMLScraper) LoadRecords

func (g *GamelistXMLScraper) LoadRecords(
	ctx context.Context,
	system scraper.ScrapeSystem,
	indexes loadRecordIndexes,
) ([]*GamelistRecord, error)

LoadRecords iterates gamelist.xml files found under each ROM root path for the given system. It prefers the original slug/title match, uses the XML path to select the concrete Media row for that title when possible, and falls back to path-only matching for records whose slug is not indexed.

func (*GamelistXMLScraper) MapToDB

func (g *GamelistXMLScraper) MapToDB(record *GamelistRecord) scraper.MapResult

MapToDB converts a GamelistRecord into the tag and property writes to apply to the matched Media and MediaTitle rows.

Jump to

Keyboard shortcuts

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