From 5d96a15113d0755d38cce9173eb86688690501a1 Mon Sep 17 00:00:00 2001 From: Louis Vallat Date: Fri, 30 Oct 2020 23:57:50 +0100 Subject: [PATCH] Sorted languages available instead of just getting the list Signed-off-by: Louis Vallat --- src/main/java/xyz/vallat/louis/commands/Command.java | 2 +- src/main/java/xyz/vallat/louis/commands/ListLangMovie.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/xyz/vallat/louis/commands/Command.java b/src/main/java/xyz/vallat/louis/commands/Command.java index 97526d5..b57d2e4 100644 --- a/src/main/java/xyz/vallat/louis/commands/Command.java +++ b/src/main/java/xyz/vallat/louis/commands/Command.java @@ -126,7 +126,7 @@ public abstract class Command { private void handleOk(String arg, EmbedCreateSpec embed, boolean isId, Movie movie, ListResponse subtitles) { embed.setColor(Color.MEDIUM_SEA_GREEN); Stream subtitlesStream = getSubtitleStream(subtitles.getData()) - .map(subtitleInfo -> subtitleInfo.getSubtitleFileId() + " - " + subtitleInfo.getLanguage()); + .map(SubtitleInfo::getLanguage).sorted(); String formattedSubtitles = subtitlesStream.limit(20).collect(Collectors.joining("\n")); embed.setDescription("You requested a list of the languages available for a movie with the " + (isId ? "IMDB Identifier" : "title") + " '" + arg + "'. "); diff --git a/src/main/java/xyz/vallat/louis/commands/ListLangMovie.java b/src/main/java/xyz/vallat/louis/commands/ListLangMovie.java index cbea752..4defd84 100644 --- a/src/main/java/xyz/vallat/louis/commands/ListLangMovie.java +++ b/src/main/java/xyz/vallat/louis/commands/ListLangMovie.java @@ -39,7 +39,7 @@ public class ListLangMovie extends Command { else throw new UnauthorizedException(""); } catch (UnauthorizedException e) { logger.error("Not logged in on OpenSubtitles! {}", e.getMessage()); - logger.warn("It may be due to a website being down. If it's not" + + logger.warn("It may be due to a website being down. If it's not " + "the case, please fix this issue quickly."); embed.setDescription("I cannot search for subtitle languages right now. Sorry."); }