gamesdb

package
v0.0.0-...-6f6a9a1 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BucketNames = "names"
)

Variables

This section is empty.

Functions

func DbExists

func DbExists() bool

Check if the gamesdb exists on disk.

func IndexedSystems

func IndexedSystems() ([]string, error)

Return all systems indexed in the gamesdb

func NameKey

func NameKey(systemId string, name string) string

Return the key for a name in the names index.

func NewNamesIndex

func NewNamesIndex(
	cfg *config.UserConfig,
	systems []games.System,
	update func(IndexStatus),
) (int, error)

Given a list of systems, index all valid game files on disk and write a names index to the DB. Overwrites any existing names index, but does not clean up old missing files.

Takes a function which will be called with the current status of the index during key steps.

Returns the total number of files indexed.

func SystemIndexed

func SystemIndexed(system games.System) bool

Return true if a specific system is indexed in the gamesdb

Types

type IndexStatus

type IndexStatus struct {
	Total    int
	Step     int
	SystemId string
	Files    int
}

type SearchResult

type SearchResult struct {
	SystemId string
	Name     string
	Path     string
}

func SearchNamesExact

func SearchNamesExact(systems []games.System, query string) ([]SearchResult, error)

Return indexed names matching exact query (case insensitive).

func SearchNamesPartial

func SearchNamesPartial(systems []games.System, query string) ([]SearchResult, error)

Return indexed names partially matching query (case insensitive).

func SearchNamesRegexp

func SearchNamesRegexp(systems []games.System, query string) ([]SearchResult, error)

Return indexed names matching query using regular expression.

func SearchNamesWords

func SearchNamesWords(systems []games.System, query string) ([]SearchResult, error)

Return indexed names that include every word in query (case insensitive).

Jump to

Keyboard shortcuts

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