fix: browse artist directories in getMusicDirectory
Symfonium uses getIndexes followed by getMusicDirectory for folder browsing. Artist entries have ar- IDs, but getMusicDirectory only handled al- and folder IDs, so drilling into an artist returned error 70 and the client showed an empty directory. Return the artist's albums as child directories, and use the same album child shape for the folder view. Add a browsing test for the artist path.
This commit is contained in:
1 parent
b86d9feb8b
commit
e08d993e35
2 files changed
+66
-11
No files matched your search
@@ -394,6 +394,32 @@ class BrowsingRoutesTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `music directory exposes artist albums for folder browsing`() {
|
||||
seededContext().use { seed ->
|
||||
testApplication {
|
||||
setupApp(seed)
|
||||
val auth = credentials("alice", "alice-pw")
|
||||
|
||||
val artist = parseBody(
|
||||
client.get("/rest/getMusicDirectory?$auth&id=${seed.aliceArtistId}").bodyAsText(),
|
||||
)["directory"]!!.jsonObject
|
||||
assertEquals(seed.aliceArtistId, artist["id"]!!.jsonPrimitive.content)
|
||||
|
||||
val albums = artist["child"]!!.jsonArray
|
||||
assertEquals(1, albums.size)
|
||||
assertEquals(seed.aliceAlbumId, albums[0].jsonObject["id"]!!.jsonPrimitive.content)
|
||||
assertEquals(seed.aliceArtistId, albums[0].jsonObject["parent"]!!.jsonPrimitive.content)
|
||||
assertEquals("true", albums[0].jsonObject["isDir"]!!.jsonPrimitive.content)
|
||||
|
||||
val album = parseBody(
|
||||
client.get("/rest/getMusicDirectory?$auth&id=${seed.aliceAlbumId}").bodyAsText(),
|
||||
)["directory"]!!.jsonObject
|
||||
assertEquals(seed.aliceSongId, album["child"]!!.jsonArray[0].jsonObject["id"]!!.jsonPrimitive.content)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `lyrics endpoint returns an empty structure when the song has no lyrics`() {
|
||||
seededContext().use { seed ->
|
||||
|
||||
Reference in new issue
Block a user