How x8rr/music works
x8rr/music is a Fastify music backend. Clients use its API to search and browse Tidal catalog data, resolve YouTube Music tracks, and request seekable audio; artwork is served through a cached proxy. Internally, YouTube Music audio is cached on disk with optional R2 persistence, while cache sweeping and source health support operation. The graph preserves README capabilities whose route implementations were not sampled; edges for those are limited to documented relationships or indexed imports. Unsampled route details are not inferred.
Main entry points: music.ts Music API · ytm.ts Audio acquisition · artCache.ts Artwork proxy · index.ts Fastify server
Components 19
API and UI
- Fastify server
index.ts - Web interface
public/index.html - Music API
routes/music.ts
Catalog and sources
- Source configuration
config/music-sources.json - Tidal catalog
lib/tidal.ts - YouTube Music search
lib/ytm.ts - Music providers
Media delivery
- Audio acquisition
lib/ytm.ts - Range streaming
lib/rangeProxy.ts - Artwork proxy
lib/artCache.ts
Cache and resilience
- Artwork disk cache
lib/artCache.ts - Audio disk cache
lib/ytm.ts - R2 object store
lib/r2.ts - Cache sweeper
lib/cacheSweep.ts - Source breaker
lib/sourceBreaker.ts - Memory cache
lib/lruCache.ts - Download gate
lib/concurrencyGate.ts - Bounded body reader
lib/readBodyAtMost.ts
Other components
- Music client
Connections 24
- Music client → Fastify server: requests
README.md - Fastify server → Music API: registers
index.ts - Fastify server → Web interface: serves
index.ts - Fastify server → Cache sweeper: starts
index.ts - Music API → Source configuration: loads
routes/music.ts - Music API → Tidal catalog: searches
routes/music.ts - Music API → YouTube Music search: searches
routes/music.ts - Music API → Audio acquisition: fetches audio
routes/music.ts - Music API → Range streaming: streams ranges
README.md - Music API → Artwork proxy: gets artwork
routes/music.ts - Tidal catalog → Music providers: queries
lib/tidal.ts - YouTube Music search → Music providers: searches
lib/ytm.ts - Audio acquisition → Music providers: downloads audio
- Audio acquisition → Audio disk cache: reads and writes
lib/ytm.ts - Audio acquisition → R2 object store: restores and stores
lib/ytm.ts - Audio acquisition → Download gate: limits downloads
lib/concurrencyGate.ts - Audio acquisition → Memory cache: caches lookups
lib/ytm.ts - Artwork proxy → Artwork disk cache: reads and writes
lib/artCache.ts - Artwork proxy → R2 object store: restores and stores
lib/artCache.ts - Artwork proxy → Bounded body reader: bounds reads
lib/artCache.ts - Artwork proxy → Cache sweeper: touches cache
lib/artCache.ts - Cache sweeper → Artwork disk cache: evicts files
lib/artCache.ts - Cache sweeper → Audio disk cache: evicts files
- Music API → Source breaker: reports source health
routes/music.ts