From 756eb481766fe64c121146c67b4ebdf22a8945aa Mon Sep 17 00:00:00 2001 From: vfsfitvnm Date: Mon, 6 Jun 2022 20:22:27 +0200 Subject: [PATCH] Fix share link for YouTube playlists --- .../vimusic/ui/screens/PlaylistOrAlbumScreen.kt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/PlaylistOrAlbumScreen.kt b/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/PlaylistOrAlbumScreen.kt index fe52a05..b9f6c42 100644 --- a/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/PlaylistOrAlbumScreen.kt +++ b/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/PlaylistOrAlbumScreen.kt @@ -194,15 +194,16 @@ fun PlaylistOrAlbumScreen( onClick = { menuState.hide() - playlistOrAlbum.valueOrNull?.url?.let { url -> - val sendIntent = Intent().apply { - action = Intent.ACTION_SEND - type = "text/plain" - putExtra(Intent.EXTRA_TEXT, url) - } + (playlistOrAlbum.valueOrNull?.url + ?: "https://music.youtube.com/playlist?list=${browseId.removePrefix("VL")}").let { url -> + val sendIntent = Intent().apply { + action = Intent.ACTION_SEND + type = "text/plain" + putExtra(Intent.EXTRA_TEXT, url) + } - context.startActivity(Intent.createChooser(sendIntent, null)) - } + context.startActivity(Intent.createChooser(sendIntent, null)) + } } ) }