Skip to content

Unofficial YouTube Music / Spotify Premium client for Android, built in Liquid Glass. Audio effects, Spotify Connect, listening history, 8 languages. Rust core on librespot.

Show the YouTube Music library when one playlist has no cover

Lelonio427d42efa778
diff --git a/innertube/src/main/kotlin/com/metrolist/innertube/models/Thumbnails.kt b/innertube/src/main/kotlin/com/metrolist/innertube/models/Thumbnails.kt
index ef2011d..1d2b6d3 100644
--- a/innertube/src/main/kotlin/com/metrolist/innertube/models/Thumbnails.kt
+++ b/innertube/src/main/kotlin/com/metrolist/innertube/models/Thumbnails.kt
@@ -4,7 +4,10 @@ import kotlinx.serialization.Serializable
@Serializable
data class Thumbnails(
- val thumbnails: List<Thumbnail>,
+ // LOCAL CHANGE: absent for a picture YouTube has none of, as on a playlist
+ // with nothing in it yet. Required, that one item failed the whole page it
+ // was on: a library with an empty playlist showed no playlists at all.
+ val thumbnails: List<Thumbnail> = emptyList(),
)
@Serializable
diff --git a/innertube/src/main/kotlin/com/metrolist/innertube/pages/LibraryPage.kt b/innertube/src/main/kotlin/com/metrolist/innertube/pages/LibraryPage.kt
index 5dd67e5..9fccaef 100644
--- a/innertube/src/main/kotlin/com/metrolist/innertube/pages/LibraryPage.kt
+++ b/innertube/src/main/kotlin/com/metrolist/innertube/pages/LibraryPage.kt
@@ -48,7 +48,10 @@ data class LibraryPage(
)
},
songCountText = renderer.subtitle?.runs?.lastOrNull()?.text,
- thumbnail = renderer.thumbnailRenderer.getThumbnailUrl() ?: return null,
+ // LOCAL CHANGE: kept without a picture, which an empty
+ // playlist has none of: dropped, it could not be opened
+ // or added to, and it is the one most likely to be next.
+ thumbnail = renderer.thumbnailRenderer.getThumbnailUrl(),
playEndpoint = renderer.thumbnailOverlay
?.musicItemThumbnailOverlayRenderer?.content
?.musicPlayButtonRenderer?.playNavigationEndpoint