mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-10 15:11:58 +01:00
fetch full-res artist art and match the old artist layout
This commit is contained in:
@@ -96,4 +96,29 @@ class SubsonicXmlTest {
|
||||
assertEquals("sg1", entries[0].songId)
|
||||
assertEquals(251L, SubsonicXml.song(1, document.getElementsByTagName("entry").item(0) as org.w3c.dom.Element).duration)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun mapsArtistImageUrls() {
|
||||
val document =
|
||||
parse(
|
||||
"""
|
||||
<subsonic-response status="ok">
|
||||
<artistInfo2>
|
||||
<smallImageUrl>https://example.com/small.jpg</smallImageUrl>
|
||||
<largeImageUrl>https://example.com/large.jpg</largeImageUrl>
|
||||
</artistInfo2>
|
||||
</subsonic-response>
|
||||
""".trimIndent(),
|
||||
)
|
||||
|
||||
assertEquals("https://example.com/large.jpg", SubsonicXml.artistImageUrl(document, thumbnail = false))
|
||||
assertEquals("https://example.com/small.jpg", SubsonicXml.artistImageUrl(document, thumbnail = true))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun artistImageUrlIsNullWhenAbsent() {
|
||||
val document = parse("""<subsonic-response status="ok"><artistInfo2/></subsonic-response>""")
|
||||
|
||||
assertEquals(null, SubsonicXml.artistImageUrl(document, thumbnail = false))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,6 +138,7 @@ class AppScreenshotTest {
|
||||
ArtistDetailScreen(
|
||||
artist = Fixtures.artists.first(),
|
||||
albums = Fixtures.albums.filter { it.artistId == Fixtures.artists.first().id },
|
||||
art = CoverArtRef("art-ar-radiohead", "test:art-ar-radiohead"),
|
||||
coverArt = { id, _ -> id?.let { CoverArtRef(it, "test:$it") } },
|
||||
onBack = {},
|
||||
onAlbumClick = {},
|
||||
|
||||
Reference in New Issue
Block a user