mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-15 00:42:54 +01:00
Polish downloads, settings, and detail titles
Use right/down chevrons in the download manager and order downloaded tracks by disc and track number, matching the album screen. Move sync concurrency to the end of the network settings, let the artist hero name wrap to six lines, and leave the album hero title unbounded.
This commit is contained in:
@@ -975,6 +975,53 @@ class DownloadRepositoryTest {
|
||||
assertFalse(file(1, "s2").exists())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun downloadedSongsFollowTheAlbumDiscAndTrackOrder() =
|
||||
runTest {
|
||||
seedLibrary()
|
||||
runBlocking {
|
||||
db.libraryDao().upsertSongs(
|
||||
listOf(
|
||||
Song(
|
||||
sourceId = 1,
|
||||
id = "s0",
|
||||
albumId = "al1",
|
||||
artistId = "ar1",
|
||||
title = "Alpha",
|
||||
album = "Album",
|
||||
artist = "Artist",
|
||||
duration = 100,
|
||||
track = 3,
|
||||
disc = 1,
|
||||
starred = null,
|
||||
genre = null,
|
||||
),
|
||||
Song(
|
||||
sourceId = 1,
|
||||
id = "s3",
|
||||
albumId = "al1",
|
||||
artistId = "ar1",
|
||||
title = "Zulu",
|
||||
album = "Album",
|
||||
artist = "Artist",
|
||||
duration = 100,
|
||||
track = 1,
|
||||
disc = 2,
|
||||
starred = null,
|
||||
genre = null,
|
||||
),
|
||||
),
|
||||
)
|
||||
listOf("s0", "s1", "s2", "s3").forEach {
|
||||
db.downloadDao().upsert(SongDownload(1, it, DownloadStatus.Completed))
|
||||
}
|
||||
}
|
||||
|
||||
val songs = runBlocking { repository.downloadedSongs(1).first() }
|
||||
|
||||
assertEquals(listOf("s1", "s2", "s0", "s3"), songs.map { it.songId })
|
||||
}
|
||||
|
||||
@Test
|
||||
fun theTreeGroupsAnAlbumUnderItsAlbumArtistNotEachTrackArtist() =
|
||||
runTest {
|
||||
|
||||
@@ -49,6 +49,21 @@ class HangingTitleTest {
|
||||
assertEquals(listOf("Boards"), splitTitle(measurer!!, "Boards", style, fullWidth, reserve))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun aLongNameWrapsToAtMostSixLines() {
|
||||
setUpMeasurements()
|
||||
|
||||
val text = (1..200).joinToString(" ") { "word$it" }
|
||||
val lines = splitTitle(measurer!!, text, style, fullWidth, reserve)
|
||||
|
||||
assertEquals(6, lines.size)
|
||||
lines.dropLast(1).forEach { line ->
|
||||
val width = measurer!!.measure(AnnotatedString(line), style, maxLines = 1).size.width
|
||||
assertTrue("every line before the last must fit the full width", width <= fullWidth)
|
||||
}
|
||||
assertTrue(lines.last().isNotEmpty())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun theLastLineStopsBeforeTheReservedWidth() {
|
||||
setUpMeasurements()
|
||||
|
||||
Reference in New Issue
Block a user