scanner

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: GPL-3.0 Imports: 14 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ScanPhase

type ScanPhase int

ScanPhase represents the current scanning phase

const (
	ScanPhaseDiscovery ScanPhase = iota
	ScanPhaseArtwork
)

type ScanProgress

type ScanProgress struct {
	Phase            ScanPhase
	Progress         float64 // 0.0 to 1.0
	GamesFound       int
	DownloadTotal    int
	DownloadComplete int
	StatusText       string
}

ScanProgress represents progress updates from the scanner

type ScanResult

type ScanResult struct {
	Errors    []error
	Cancelled bool
}

ScanResult represents the final scan result

type Scanner

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

Scanner handles ROM scanning in the background

func NewScanner

func NewScanner(dirs []storage.ScanDirectory, excluded []string, existing map[string]*storage.GameEntry, extensions []string, defaultConsoleID int, disc bool, discID coreif.DiscIdentifier, sources Sources) *Scanner

NewScanner creates a new scanner instance. existing holds the entries whose user data a scan keeps when it finds their game: the library and the removed games.

func (*Scanner) Cancel

func (s *Scanner) Cancel()

Cancel signals the scanner to stop

func (*Scanner) Done

func (s *Scanner) Done() <-chan ScanResult

Done returns the done channel

func (*Scanner) Games

func (s *Scanner) Games() map[string]*storage.GameEntry

Games returns the discovered games

func (*Scanner) Progress

func (s *Scanner) Progress() <-chan ScanProgress

Progress returns the progress channel

func (*Scanner) Run

func (s *Scanner) Run()

Run starts the scanning process

type Sources added in v0.8.0

type Sources struct {
	ArtworkURL      string   // HTTPS base URL of the artwork site
	ArtworkKeys     []string // keys trusted to sign the artwork index, as algorithm:base64
	ArtworkDownload string   // which images to download: a storage.ArtworkDownload* setting
}

Sources are where a scan downloads artwork from, and which artwork. An empty URL turns artwork downloads off; the app leaves it empty when the emulator does not publish artwork.

Jump to

Keyboard shortcuts

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