rom

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2017 License: MIT Imports: 12 Imported by: 21

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetMaxImg added in v1.0.9

func SetMaxImg(x int)

SetMaxImg sets the maximum number of threads that are allowed to have an open image.

Types

type GameListXML

type GameListXML struct {
	XMLName  xml.Name   `xml:"gameList"`
	GameList []*GameXML `xml:"game"`
}

GameListXML is the structure used to export the gamelist.xml file.

func (*GameListXML) Append

func (gl *GameListXML) Append(g *GameXML)

Append appeads a GameXML to the GameList.

type GameOpts

type GameOpts struct {
	// AddNotFound instructs the scraper to create a Game even if the game isn't in the sources.
	AddNotFound bool
	// NoPrettyName instructs the scraper to leave the name as the name in the source.
	NoPrettyName bool
	// UseFilename instructs the scraper to use the filename minus extension as the xml name.
	UseFilename bool
	// NoStripUnicode instructs the scraper to not strip out unicode characters.
	NoStripUnicode bool
	// OverviewLen is the max length allowed for a overview. 0 means no limit.
	OverviewLen int
}

GameOpts represents the options for creating Game information.

type GameXML

type GameXML struct {
	XMLName     xml.Name `xml:"game"`
	ID          string   `xml:"id,attr"`
	Source      string   `xml:"source,attr"`
	Path        string   `xml:"path"`
	GameTitle   string   `xml:"name"`
	Overview    string   `xml:"desc"`
	Image       string   `xml:"image,omitempty"`
	Thumb       string   `xml:"thumbnail,omitempty"`
	Rating      float64  `xml:"rating,omitempty"`
	ReleaseDate string   `xml:"releasedate"`
	Developer   string   `xml:"developer"`
	Publisher   string   `xml:"publisher"`
	Genre       string   `xml:"genre"`
	Players     string   `xml:"players,omitempty"`
	PlayCount   string   `xml:"playcount,omitempty"`
	LastPlayed  string   `xml:"lastplayed,omitempty"`
	Favorite    string   `xml:"favorite,omitempty"`
}

GameXML is the object used to export the <game> elements of the gamelist.xml.

type ROM

type ROM struct {
	Path     string
	Dir      string
	BaseName string
	FileName string
	Ext      string
	Bins     []string
	Cue      bool
	Game     *ds.Game
	NotFound bool
}

ROM stores information about the ROM.

func NewROM

func NewROM(p string) (*ROM, error)

NewROM creates a new ROM and populates path and bin information.

func (*ROM) GetGame

func (r *ROM) GetGame(ctx context.Context, data []ds.DS, opts *GameOpts) error

GetGame attempts to populates the Game from data sources in oder.

func (*ROM) XML

func (r *ROM) XML(ctx context.Context, opts *XMLOpts) (*GameXML, error)

XML creates the XML for the ROM after the Game has been populates.

type XMLOpts

type XMLOpts struct {
	// RomDir is the base directory for scraping rom files.
	RomDir string
	// RomXMLDir is the base directory where roms will be located on the target system.
	RomXMLDir string
	// NestImgDir if true tells the scraper to use the same directory structure of roms for rom images.
	NestImgDir bool
	// ImgDir is the base directory for downloading images.
	ImgDir string
	// ImgXMLDir is the directory where images will be located on the target system.
	ImgXMLDir string
	// ImgPriority is the order or image preference when multiple images are avialable.
	ImgPriority []ds.ImgType
	// ImgSuffix is what will be appened to the end of the rom's name to name the image
	// ie rom.bin with suffix of "-image" results in rom-image.jpg
	ImgSuffix string
	// ThumbOnly tells the scraper to prefer thumbnail size images when available.
	ThumbOnly bool
	// NoDownload tells the scraper to not download images.
	NoDownload bool
	// ImgFormat is the format for the image, currently only "jpg" and "png" are supported.
	ImgFormat string
	// ImgWidth is the max width of images. Anything larger will be resized.
	ImgWidth uint
	// ImgHeight is the max height of images. Anything larger will be resized.
	ImgHeight uint
}

XMLOpts represents the options for creating XML information.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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