Documentation
¶
Index ¶
- Constants
- func PosterSize(width, height int, layout domain.CoverLayout) (int, int)
- type Artwork
- type Cache
- func (cache *Cache) Exists(artwork Artwork) (bool, error)
- func (cache *Cache) FromCover(body []byte, layout domain.CoverLayout) (Artwork, error)
- func (cache *Cache) LockArtwork(ctx context.Context) error
- func (cache *Cache) Prune(ctx context.Context, retained map[string]bool) error
- func (cache *Cache) Read(key string) ([]byte, error)
- func (cache *Cache) ReadURL(url string) ([]byte, error)
- func (cache *Cache) RecropPoster(artwork Artwork, layout domain.CoverLayout) (Artwork, error)
- func (cache *Cache) Restore(poster, fanart []byte) (Artwork, error)
- func (cache *Cache) Stats(ctx context.Context, retained map[string]bool) (CacheStats, error)
- func (cache *Cache) TryLockArtwork() bool
- func (cache *Cache) UnlockArtwork()
- type CacheStats
Constants ¶
View Source
const PosterVersion = 2
PosterVersion invalidates generated posters when their composition changes.
View Source
const URLPrefix = "/api/library/artwork/"
Variables ¶
This section is empty.
Functions ¶
func PosterSize ¶ added in v0.2.0
func PosterSize(width, height int, layout domain.CoverLayout) (int, int)
PosterSize measures the usable original pixels under the same layout policy used for cropping. It never treats upscaling as additional detail.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func (*Cache) LockArtwork ¶ added in v0.2.0
Hold the artwork lock from cache writes through the commit of their database references. Pruning takes the same lock before reading those references.
func (*Cache) Prune ¶ added in v0.0.3
Prune removes only cache-owned JPEG files. The caller must serialize the reference snapshot and pruning with artwork generation and publication.
func (*Cache) RecropPoster ¶ added in v0.2.0
RecropPoster upgrades a generated poster from the cached full cover, keeping the original fanart and thumbnail bytes and URLs intact.
func (*Cache) TryLockArtwork ¶ added in v0.2.0
func (*Cache) UnlockArtwork ¶ added in v0.2.0
func (cache *Cache) UnlockArtwork()
Click to show internal directories.
Click to hide internal directories.