feat: rebuild AudioManager around downloadable moods
CI / chart (push) Successful in 3s
CI / test (push) Successful in 2m2s
CI / chart-push (push) Successful in 4s
CI / image (push) Successful in 3m20s

- V8 wipe migration and the shared song store keyed by YouTube video id
- media store, indexer, downloader, recommendation top-up and refcounted GC
- mood songs plus the recommendation lifecycle and mixed radio pools
- new search, song and recommendation API; remove library/longform/seed routes
- chart PVC/media env, docs, Nix, README and an end-to-end smoke test
This commit is contained in:
TapTap committed 2026-11-15 21:37:39 +00:00
1 parent 50d8b6c580
commit 824eb36dd2
59 files changed
+3838 -5276

No files matched your search

@@ -15,42 +15,29 @@ class IdGeneratorTest {
}
@Test
fun `IDs are deterministic, prefixed and 24 hex characters`() {
val first = IdGenerator.artistId("The Beatles")
val second = IdGenerator.artistId("the beatles")
fun `song IDs are deterministic, prefixed and 24 hex characters`() {
val first = IdGenerator.songId("dQw4w9WgXcQ")
val second = IdGenerator.songId(" dQw4w9WgXcQ ")
assertEquals(first, second)
assertTrue(first.startsWith("ar-"))
assertTrue(first.startsWith("sg-"))
assertEquals(27, first.length)
val album = IdGenerator.albumId("The Beatles", "Abbey Road")
assertTrue(album.startsWith("al-"))
assertEquals(27, album.length)
val song = IdGenerator.songId(1, "The Beatles/Abbey Road/01 - Come Together.mp3")
assertTrue(song.startsWith("sg-"))
assertEquals(27, song.length)
}
@Test
fun `path separators do not change the song ID`() {
val unix = IdGenerator.songId(1, "Artist/Album/song.mp3")
val windows = IdGenerator.songId(1, "Artist\\Album\\song.mp3")
val prefixed = IdGenerator.songId(1, "./Artist/Album/song.mp3")
assertEquals(unix, windows)
assertEquals(unix, prefixed)
fun `different videos produce different IDs`() {
assertNotEquals(
IdGenerator.songId("dQw4w9WgXcQ"),
IdGenerator.songId("dQw4w9WgXcR"),
)
}
@Test
fun `folder and album changes produce different IDs`() {
assertNotEquals(
IdGenerator.songId(1, "Artist/Album/song.mp3"),
IdGenerator.songId(2, "Artist/Album/song.mp3"),
)
assertNotEquals(
IdGenerator.albumId("Artist", "Album"),
IdGenerator.albumId("Artist", "Other Album"),
)
fun `mood IDs are deterministic for the same inputs`() {
val id = IdGenerator.moodId("Alice", "Focus", "2026-01-01T00:00:00Z")
assertTrue(id.startsWith("mo-"))
assertEquals(id, IdGenerator.moodId("alice", " Focus ", "2026-01-01T00:00:00Z"))
assertNotEquals(id, IdGenerator.moodId("Alice", "Focus", "2026-01-02T00:00:00Z"))
}
}