common

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const CollectionDirectory = "/mnt/SDCARD/Collections"
View Source
const RomDirectory = "/mnt/SDCARD/Roms"
View Source
const SDCardRoot = "/mnt/SDCARD"
View Source
const ThumbnailServerRoot = "https://thumbnails.libretro.com"

Variables

View Source
var InMemoryCache map[string]map[string]models.Items
View Source
var OrderedFolderRegex = regexp.MustCompile(`\d+\)\s`)
View Source
var TagRegex = regexp.MustCompile(`\((.*?)\)`)

Functions

func DeleteFile

func DeleteFile(path string) bool

func GetLoggerInstance

func GetLoggerInstance() *slog.Logger

func GetRomDirectory added in v1.12.0

func GetRomDirectory() string

func InitIncludes added in v1.1.0

func InitIncludes()

func IsConnectedToInternet added in v1.8.0

func IsConnectedToInternet() bool

func IsDev added in v1.12.0

func IsDev() bool

func ItemNameCleaner added in v1.10.0

func ItemNameCleaner(filename string, stripTag bool) (string, string)

func LoadSystemMapping added in v1.10.0

func LoadSystemMapping() map[string]string

func LogStandardFatal

func LogStandardFatal(msg string, err error)

Types

type HostType

type HostType = sum.Int[models.HostType]

type HttpTableClient

type HttpTableClient struct {
	RootURL            string
	HostType           HostType
	TableColumns       models.TableColumns
	SourceReplacements map[string]string
	Filters            []string
}

func NewHttpTableClient

func NewHttpTableClient(rootURL string, hostType HostType, tableColumns models.TableColumns,
	sourceReplacements map[string]string, filters []string) *HttpTableClient

func (*HttpTableClient) BuildDownloadHeaders added in v1.5.0

func (c *HttpTableClient) BuildDownloadHeaders() map[string]string

func (*HttpTableClient) Close

func (c *HttpTableClient) Close() error

func (*HttpTableClient) ListDirectory

func (c *HttpTableClient) ListDirectory(subdirectory string) (models.Items, error)

type ThumbnailClient

type ThumbnailClient struct {
	HttpTableClient
	SystemMapping   map[string]string
	ArtDownloadType sum.Int[models.ArtDownloadType]
}

func NewThumbnailClient

func NewThumbnailClient(artDownloadType sum.Int[models.ArtDownloadType]) *ThumbnailClient

func (*ThumbnailClient) BuildDownloadHeaders added in v1.5.0

func (c *ThumbnailClient) BuildDownloadHeaders() map[string]string

func (*ThumbnailClient) BuildThumbnailSection

func (c *ThumbnailClient) BuildThumbnailSection(tag string) models.Section

func (*ThumbnailClient) Close

func (c *ThumbnailClient) Close() error

func (*ThumbnailClient) DownloadArt added in v1.6.0

func (c *ThumbnailClient) DownloadArt(remotePath, localPath, filename, rename string) (savedPath string, error error)

func (*ThumbnailClient) ListDirectory

func (c *ThumbnailClient) ListDirectory(subdirectory string) (models.Items, error)

Jump to

Keyboard shortcuts

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