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 ¶
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 {
AvailableMediaDirs 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.