address review nits: cover art flags, artist retry, subtitle fallback

This commit is contained in:
austinried
2026-10-04 00:29:54 +00:00
parent e7dcd808dd
commit 0203deae90
3 changed files with 4 additions and 3 deletions
@@ -33,8 +33,8 @@ fun CoverArt(
showPlaceholder: Boolean = true, showPlaceholder: Boolean = true,
) { ) {
val context = LocalPlatformContext.current val context = LocalPlatformContext.current
var failed by remember(ref) { mutableStateOf(false) } var failed by remember(ref, thumbnailRef) { mutableStateOf(false) }
var thumbnailLoaded by remember(thumbnailRef) { mutableStateOf(false) } var thumbnailLoaded by remember(ref, thumbnailRef) { mutableStateOf(false) }
Box(modifier = modifier.background(MaterialTheme.colorScheme.surfaceVariant)) { Box(modifier = modifier.background(MaterialTheme.colorScheme.surfaceVariant)) {
if (showPlaceholder || (failed && !thumbnailLoaded)) { if (showPlaceholder || (failed && !thumbnailLoaded)) {
Text( Text(
@@ -48,6 +48,7 @@ class ArtistDetailViewModel(
} }
private suspend fun resolveArt(artist: Artist): Pair<CoverArtRef?, CoverArtRef?> { private suspend fun resolveArt(artist: Artist): Pair<CoverArtRef?, CoverArtRef?> {
if (artist.coverArt == null) return null to null
repeat(3) { attempt -> repeat(3) { attempt ->
val full = sourceRepository.coverArt(artist.coverArt) val full = sourceRepository.coverArt(artist.coverArt)
if (full != null) { if (full != null) {
@@ -81,7 +81,7 @@ fun MiniPlayer(
modifier = Modifier.basicMarquee(), modifier = Modifier.basicMarquee(),
) )
Text( Text(
text = item.artist.orEmpty(), text = item.artist ?: item.album.orEmpty(),
style = MaterialTheme.typography.bodySmall, style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant, color = MaterialTheme.colorScheme.onSurfaceVariant,
maxLines = 1, maxLines = 1,