From c4d5c3cfd47bc8aae02b4bb6f7ac7981f906ec47 Mon Sep 17 00:00:00 2001 From: AudricV <74829229+AudricV@users.noreply.github.com> Date: Sun, 20 Aug 2023 17:44:44 +0200 Subject: [PATCH] Add uploader name of streams as subtitle of MediaItems They should be displayed only by Android Auto if they are known, i.e. when they are not empty. --- .../newpipe/player/mediabrowser/MediaBrowserConnector.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/org/schabi/newpipe/player/mediabrowser/MediaBrowserConnector.java b/app/src/main/java/org/schabi/newpipe/player/mediabrowser/MediaBrowserConnector.java index df85d0e407d..7a383e09616 100644 --- a/app/src/main/java/org/schabi/newpipe/player/mediabrowser/MediaBrowserConnector.java +++ b/app/src/main/java/org/schabi/newpipe/player/mediabrowser/MediaBrowserConnector.java @@ -139,6 +139,7 @@ private MediaItem createPlaylistStreamMediaItem(final long playlistId, final var builder = new MediaDescriptionCompat.Builder(); builder.setMediaId(createMediaIdForPlaylistIndex(playlistId, index)) .setTitle(item.getStreamEntity().getTitle()) + .setSubtitle(item.getStreamEntity().getUploader()) .setIconUri(Uri.parse(item.getStreamEntity().getThumbnailUrl())); return new MediaItem(builder.build(), MediaItem.FLAG_PLAYABLE); @@ -207,6 +208,7 @@ private MediaItem createHistoryMediaItem(@NonNull final StreamHistoryEntry strea final var builder = new MediaDescriptionCompat.Builder(); builder.setMediaId(ID_STREAM + '/' + streamHistoryEntry.getStreamId()) .setTitle(streamHistoryEntry.getStreamEntity().getTitle()) + .setSubtitle(streamHistoryEntry.getStreamEntity().getUploader()) .setIconUri(Uri.parse(streamHistoryEntry.getStreamEntity().getThumbnailUrl())); return new MediaItem(builder.build(), MediaItem.FLAG_PLAYABLE);