New GET /api/v1/art/album?artist=&album= resolves and streams an album's cover art. Lookups go through MusicBrainz release-group search then Cover Art Archive's release-group front-image endpoint, both free and keyless - no setup required by self-hosters. Results (hits, misses and errors) are cached in a new album_art table keyed case-insensitively on (artist, album), since Scrobble.mbid can't be trusted as a release identifier. The service layer separates resolving where the art is (lookup()) from fetching the bytes (fetch_image()) so a future move to storing the bytes ourselves only touches the latter. Also widens the UI's CSP (img-src) to allow blob: URLs, since the frontend will fetch art with the existing bearer-auth header and hand the browser a blob: object URL rather than hotlinking. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
37 lines
1.3 KiB
Bash
37 lines
1.3 KiB
Bash
# Copy to .env for local development.
|
|
# Host port docker compose publishes Postgres on.
|
|
DB_PORT=5432
|
|
DATABASE_URL=postgresql+psycopg://scrobbler:scrobbler@localhost:5432/scrobbler
|
|
TEST_DATABASE_URL=postgresql+psycopg://scrobbler:scrobbler@localhost:5432/scrobbler_test
|
|
SECRET_KEY=change-me
|
|
|
|
# Origin(s) of the static UI allowed to call /api/v1 (comma separated).
|
|
CORS_ORIGINS=http://localhost:8080
|
|
# Where Last.fm clients are redirected to approve desktop auth tokens.
|
|
UI_BASE_URL=http://localhost:8080
|
|
|
|
# Prometheus metrics are served on a separate port.
|
|
METRICS_PORT=9100
|
|
|
|
# Set to allow importing history straight from Last.fm (https://www.last.fm/api/account/create).
|
|
LASTFM_API_KEY=
|
|
|
|
# Album art (MusicBrainz + Cover Art Archive, both free and keyless — no setup required).
|
|
# MusicBrainz asks for a contact URL/email in requests; falls back to UI_BASE_URL if unset.
|
|
MUSICBRAINZ_CONTACT=
|
|
|
|
# docker compose host ports (defaults shown)
|
|
API_PORT=5050
|
|
UI_PORT=8080
|
|
PROMETHEUS_PORT=9090
|
|
GRAFANA_PORT=3000
|
|
GRAFANA_ADMIN_PASSWORD=admin
|
|
|
|
# ActivityPub federation (in development; off by default). See src/scrobbler/federation/README.md.
|
|
# Use the web UI's host and origin: handles become @user@<FEDERATION_DOMAIN>.
|
|
FEDERATION_ENABLED=0
|
|
FEDERATION_DOMAIN=
|
|
FEDERATION_BASE_URL=
|
|
# 32+ characters; encrypts actors' private keys. Keep it safe and never change it.
|
|
FEDERATION_KEY_SECRET=
|