fix(home): buildSongsLikeRow ReturnCount ≤ 2 (detekt)
android / Build + lint + test (push) Failing after 3m4s
android / Build + lint + test (push) Failing after 3m4s
Collapse the three early returns into a single `when` expression — detekt's ReturnCount capped at 2. No behavior change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1094,13 +1094,15 @@ internal fun buildSongsLikeRow(
|
||||
offline: Boolean,
|
||||
): List<PlaylistRowItem> {
|
||||
val mixes = owned.filter { it.systemVariant == "songs_like_artist" }
|
||||
if (offline) {
|
||||
val (available, greyed) = mixes.partition { !it.unavailableOffline }
|
||||
return (available + greyed).map { PlaylistRowItem.Real(it) }
|
||||
}
|
||||
if (mixes.isNotEmpty()) return mixes.map { PlaylistRowItem.Real(it) }
|
||||
return List(SONGS_LIKE_PLACEHOLDER_SLOTS) {
|
||||
PlaylistRowItem.Placeholder("Songs like…", variantFor("songs-like", status))
|
||||
return when {
|
||||
offline -> {
|
||||
val (available, greyed) = mixes.partition { !it.unavailableOffline }
|
||||
(available + greyed).map { PlaylistRowItem.Real(it) }
|
||||
}
|
||||
mixes.isNotEmpty() -> mixes.map { PlaylistRowItem.Real(it) }
|
||||
else -> List(SONGS_LIKE_PLACEHOLDER_SLOTS) {
|
||||
PlaylistRowItem.Placeholder("Songs like…", variantFor("songs-like", status))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user