artwork

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: AGPL-3.0 Imports: 13 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

This section is empty.

Variables

This section is empty.

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.

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