Sorted languages available instead of just getting the list
Signed-off-by: Louis Vallat <louis@louis-vallat.xyz>
This commit is contained in:
parent
2f3ebf0509
commit
5d96a15113
@ -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 + "'. ");
|
||||||
|
Loading…
Reference in New Issue
Block a user