artwork

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: AGPL-3.0 Imports: 17 Imported by: 0 modules, 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

Overview

Package artwork serves posters and backdrops from local files, a cache of remote images, or pictures embedded in audio files.

Index

Constants

View Source
const (
	LibretroThumbnails       = "https://thumbnails.libretro.com/"
	LibretroThumbnailsMirror = "https://raw.githubusercontent.com/libretro-thumbnails/"
)

LibretroThumbnails is libretro's thumbnail site, and LibretroThumbnailsMirror the copy of it libretro keeps on GitHub, one repository per system.

Variables

View Source
var FailedWait = time.Hour

FailedWait is how long an image that couldn't be had (a cover art site that doesn't have it, a video a still can't be taken from) waits before it's tried again.

Functions

func Large

func Large(src, kind string) string

Large is src at the size a 4K TV shows it: TMDB's original for backdrops and its largest sized poster. Other sources are already as big as they get.

func LibretroMirror added in v0.2.11

func LibretroMirror(src string) string

LibretroMirror is the address of a libretro thumbnail on GitHub, for src on libretro's thumbnail site, or "". The site's "<System>/<Kind>/<Game>.png" is in the repository named after the system, with its spaces as underscores.

func LibretroRepo added in v0.2.11

func LibretroRepo(system string) string

LibretroRepo is the name of the GitHub repository that holds a system's thumbnails: "Nintendo - Game Boy" is Nintendo_-_Game_Boy.

Types

type Cache

type Cache struct {
	Dir    string
	FFmpeg string
	Client *http.Client
	// Chosen loads a cover an admin picked, for a "chosen:" source; nil
	// has none.
	Chosen func(ctx context.Context, src string) ([]byte, error)
	// contains filtered or unexported fields
}

func NewCache

func NewCache(dir, ffmpeg string) *Cache

func (*Cache) Serve

func (c *Cache) Serve(w http.ResponseWriter, r *http.Request, src string, fallbacks ...string)

Serve writes the image src points at: a local path, an http(s) URL (downloaded once, then served from the cache), "embedded:<audio file>", or "chosen:…" for a cover an admin picked. Further sources are tried in turn when one can't be had.

Jump to

Keyboard shortcuts

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