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) {
|
||||
embed.setColor(Color.MEDIUM_SEA_GREEN);
|
||||
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"));
|
||||
embed.setDescription("You requested a list of the languages available for a movie with the " +
|
||||
(isId ? "IMDB Identifier" : "title") + " '" + arg + "'. ");
|
||||
|
@ -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.");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user