common

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2025 License: MIT Imports: 21 Imported by: 5

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 LoggerInitialized atomic.Bool
View Source
var OrderedFolderRegex = regexp.MustCompile(`\d+\)\s`)
View Source
var TagRegex = regexp.MustCompile(`\((.*?)\)`)

Functions

func CloseLogger

func CloseLogger()

func ConfigureEnvironment

func ConfigureEnvironment()

func DeleteFile

func DeleteFile(path string) bool

func GetLoggerInstance

func GetLoggerInstance() *zap.Logger

func HttpDownload

func HttpDownload(rootURL, remotePath, localPath, filename string) (savedPath string, error error)

func HttpDownloadRename

func HttpDownloadRename(rootURL, remotePath, localPath, filename, rename string) (savedPath string, error error)

func InitIncludes added in v1.1.0

func InitIncludes()

func LogStandardFatal

func LogStandardFatal(msg string, err error)

func SetLogLevel

func SetLogLevel(rawLevel string)

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) Close

func (c *HttpTableClient) Close() error

func (*HttpTableClient) DownloadFile

func (c *HttpTableClient) DownloadFile(remotePath, localPath, filename string) (string, error)

func (*HttpTableClient) DownloadFileRename

func (c *HttpTableClient) DownloadFileRename(remotePath, localPath, filename, rename string) (string, 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) BuildThumbnailSection

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

func (*ThumbnailClient) Close

func (c *ThumbnailClient) Close() error

func (*ThumbnailClient) DownloadFile

func (c *ThumbnailClient) DownloadFile(remotePath, localPath, filename string) (lastSavedPath string, error error)

func (*ThumbnailClient) DownloadFileRename

func (c *ThumbnailClient) DownloadFileRename(remotePath, localPath, filename, rename string) (lastSavedPath string, error error)

func (*ThumbnailClient) ListDirectory

func (c *ThumbnailClient) ListDirectory(section models.Section) (models.Items, error)

Jump to

Keyboard shortcuts

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