mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-11 15:29:15 +01:00
address review nits: cover art flags, artist retry, subtitle fallback
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user