Fix outputs

This commit is contained in:
hodasemi 2018-11-17 19:59:10 +01:00
parent cc816c1ee2
commit ffdfb37f9d
2 changed files with 9 additions and 5 deletions

View file

@ -34,8 +34,14 @@ impl serenity::framework::standard::Command for List {
if playlist.len() == 1 { "song" } else { "songs" } if playlist.len() == 1 { "song" } else { "songs" }
); );
let max_output = 15;
for (i, song) in playlist.iter().enumerate() { for (i, song) in playlist.iter().enumerate() {
if i < max_output {
output += &format!("\t{}.\t{}\n", i + 1, song.name.clone()); output += &format!("\t{}.\t{}\n", i + 1, song.name.clone());
} else {
output += &format!("\t... and {} more", playlist.len() - max_output);
}
} }
} }

View file

@ -193,10 +193,10 @@ impl MediaData {
if playlist.is_empty() { if playlist.is_empty() {
return false; return false;
} else { } else {
let first = playlist.remove(0);
handler.stop(); handler.stop();
let first = playlist.remove(0);
let source = match ffmpeg(first.name.clone()) { let source = match ffmpeg(first.name.clone()) {
Ok(mpeg) => mpeg, Ok(mpeg) => mpeg,
Err(_) => { Err(_) => {
@ -216,8 +216,6 @@ impl MediaData {
return false; return false;
} }
fn set_song() {}
} }
impl Default for MediaData { impl Default for MediaData {