Sorted languages available instead of just getting the list

Signed-off-by: Louis Vallat <louis@louis-vallat.xyz>
This commit is contained in:
Louis Vallat 2020-10-30 23:57:50 +01:00
parent 2f3ebf0509
commit 5d96a15113
2 changed files with 2 additions and 2 deletions

View File

@ -126,7 +126,7 @@ public abstract class Command {
private void handleOk(String arg, EmbedCreateSpec embed, boolean isId, Movie movie, ListResponse<SubtitleInfo> subtitles) { private void handleOk(String arg, EmbedCreateSpec embed, boolean isId, Movie movie, ListResponse<SubtitleInfo> subtitles) {
embed.setColor(Color.MEDIUM_SEA_GREEN); embed.setColor(Color.MEDIUM_SEA_GREEN);
Stream<String> subtitlesStream = getSubtitleStream(subtitles.getData()) Stream<String> subtitlesStream = getSubtitleStream(subtitles.getData())
.map(subtitleInfo -> subtitleInfo.getSubtitleFileId() + " - " + subtitleInfo.getLanguage()); .map(SubtitleInfo::getLanguage).sorted();
String formattedSubtitles = subtitlesStream.limit(20).collect(Collectors.joining("\n")); String formattedSubtitles = subtitlesStream.limit(20).collect(Collectors.joining("\n"));
embed.setDescription("You requested a list of the languages available for a movie with the " + embed.setDescription("You requested a list of the languages available for a movie with the " +
(isId ? "IMDB Identifier" : "title") + " '" + arg + "'. "); (isId ? "IMDB Identifier" : "title") + " '" + arg + "'. ");