Compare commits

..

1 Commits

Author SHA1 Message Date
Davide Polonio d95d262b4d feat: improve formatting output
* duration is now in human readable format
* list of artists is now capped at 140 chars max
2021-11-13 16:35:42 +01:00
1 changed files with 2 additions and 2 deletions

View File

@ -4,7 +4,7 @@ use crate::spotify::TrackInfo;
use spotify::SpotifyKind::Track; use spotify::SpotifyKind::Track;
use crate::spotify::SpotifyKind::{Album, Playlist}; use crate::spotify::SpotifyKind::{Album, Playlist};
use crate::utils::truncate_with_dots; use crate::utils::{human_readable_duration, truncate_with_dots};
mod spotify; mod spotify;
mod utils; mod utils;
@ -35,7 +35,7 @@ async fn main() {
Duration: {} second(s)", Duration: {} second(s)",
info.name, info.name,
truncate_with_dots(info.artists.join(", "), MAX_ARTISTS_CHARS), truncate_with_dots(info.artists.join(", "), MAX_ARTISTS_CHARS),
info.duration.as_secs() human_readable_duration(info.duration)
); );
Some(message.reply_to(reply).await?) Some(message.reply_to(reply).await?)
} }