Skip to content

Commit

Permalink
Add uploader name of streams as subtitle of MediaItems
Browse files Browse the repository at this point in the history
They should be displayed only by Android Auto if they are known, i.e. when they
are not empty.
  • Loading branch information
AudricV authored and haggaie committed May 29, 2024
1 parent 4ace2f4 commit c4d5c3c
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit c4d5c3c

Please sign in to comment.