From f15c35ba2706ce85a8055258b2f0fd8648aeb9e4 Mon Sep 17 00:00:00 2001 From: Siddhesh Naik Date: Sun, 17 Sep 2023 15:33:08 +0530 Subject: [PATCH] Add playlist name and video name in playlist sharing content - Currently, only a list of videos separated by newline are added in the share content. - This makes it difficult to identify a specific video in a list of Urls. - Added Playlist name as the header and corresponding video name for each video url in following format. ``` My Playlist - Music1: https://media-url1 - Music2: https://media-url2 - Music3: https://media-url3 ``` Screenshot: | Before | After | | --- | --- | | | | --- .../newpipe/local/playlist/LocalPlaylistFragment.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/local/playlist/LocalPlaylistFragment.java b/app/src/main/java/org/schabi/newpipe/local/playlist/LocalPlaylistFragment.java index 0d8f81334..a4023ce94 100644 --- a/app/src/main/java/org/schabi/newpipe/local/playlist/LocalPlaylistFragment.java +++ b/app/src/main/java/org/schabi/newpipe/local/playlist/LocalPlaylistFragment.java @@ -374,16 +374,18 @@ public class LocalPlaylistFragment extends BaseLocalListFragment Single.just(playlist.stream() .map(PlaylistStreamEntry::getStreamEntity) - .map(StreamEntity::getUrl) + .map(streamEntity -> String.format("- %s: %s", + streamEntity.getTitle(), streamEntity.getUrl())) .collect(Collectors.joining("\n")))) .observeOn(AndroidSchedulers.mainThread()) - .subscribe(urlsText -> ShareUtils.shareText(requireContext(), name, urlsText), + .subscribe(urlsText -> ShareUtils.shareText( + requireContext(), name, String.format("%s\n%s", name, urlsText)), throwable -> showUiErrorSnackbar(this, "Sharing playlist", throwable))); }