Skip to content

Commit

Permalink
Fix radio in home page
Browse files Browse the repository at this point in the history
  • Loading branch information
maxrave-dev committed Dec 4, 2024
1 parent 08d81a8 commit 6bfee80
Showing 1 changed file with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,23 @@ data class RelatedPage(
?.musicItemThumbnailOverlayRenderer?.content
?.musicPlayButtonRenderer?.playNavigationEndpoint
?.watchPlaylistEndpoint ?: return null,
// If the playlist is radio, shuffle is not available
shuffleEndpoint =
renderer.menu?.menuRenderer?.items?.find {
it.menuNavigationItemRenderer?.icon?.iconType == "MUSIC_SHUFFLE"
}?.menuNavigationItemRenderer?.navigationEndpoint?.watchPlaylistEndpoint
?: return null,
renderer.menu?.menuRenderer?.items?.find {
it.menuNavigationItemRenderer?.icon?.iconType == "MUSIC_SHUFFLE"
}?.menuNavigationItemRenderer?.navigationEndpoint?.watchPlaylistEndpoint
?: renderer.thumbnailOverlay
.musicItemThumbnailOverlayRenderer.content
.musicPlayButtonRenderer.playNavigationEndpoint
.watchPlaylistEndpoint,
radioEndpoint =
renderer.menu.menuRenderer.items.find {
renderer.menu?.menuRenderer?.items?.find {
it.menuNavigationItemRenderer?.icon?.iconType == "MIX"
}?.menuNavigationItemRenderer?.navigationEndpoint?.watchPlaylistEndpoint,
}?.menuNavigationItemRenderer?.navigationEndpoint?.watchPlaylistEndpoint
?: renderer.thumbnailOverlay
.musicItemThumbnailOverlayRenderer.content
.musicPlayButtonRenderer.playNavigationEndpoint
.watchPlaylistEndpoint,
)

renderer.isArtist -> {
Expand Down

0 comments on commit 6bfee80

Please sign in to comment.