diff --git a/assets/emojis/dz_previous.png b/assets/emojis/dz_previous.png new file mode 100644 index 0000000..5c8d159 Binary files /dev/null and b/assets/emojis/dz_previous.png differ diff --git a/assets/emojis/dz_previous.svg b/assets/emojis/dz_previous.svg new file mode 100644 index 0000000..7285caf --- /dev/null +++ b/assets/emojis/dz_previous.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/commands/lastfm/views.rs b/src/commands/lastfm/views.rs index 29c67c5..386570a 100644 --- a/src/commands/lastfm/views.rs +++ b/src/commands/lastfm/views.rs @@ -72,12 +72,17 @@ pub async fn now_playing(b: &Base) -> Result<(Component, Option>), Error let picture = super::art::now_playing(&super::art::Now { status, title: title.to_string(), artist: artist.to_string(), album: album.map(str::to_string), accent, cover: art_image, stats, previous }); let mut links = vec![link(&truncate(title, 60), track["url"].as_str()), link(artist, Some(&fm_url(&[artist])))]; links.push(format!("[{}]()", escape(&b.username), b.username)); - if !playing { - if let Some(uts) = track["date"]["uts"].as_str() { - links.push(format!("")); + // said in words too: the status inside the picture is easy to miss + let heading = if playing { + format!("-# {PLAYING_EMOJI} Now playing · {}", escape(&b.name)) + } else { + let previous = crate::emojis::in_text("⏮️"); + match track["date"]["uts"].as_str() { + Some(uts) => format!("-# {previous} Last played · {}", escape(&b.name)), + None => format!("-# {previous} Last played · {}", escape(&b.name)), } - } - let mut card = Card::new(Some(accent)).gallery(&[&format!("attachment://{}", super::art::FILE)]).footer(&links.join(" · ")); + }; + let mut card = Card::new(Some(accent)).text(&heading).gallery(&[&format!("attachment://{}", super::art::FILE)]).footer(&links.join(" · ")); if let Some(url) = track["url"].as_str().filter(|u| track_from_url(u).is_some()) { let go = twilight_model::channel::message::component::Button { id: None, custom_id: None, disabled: false, emoji: Some(twilight_model::channel::message::EmojiReactionType::Unicode { name: "🎵".into() }), label: Some("Go to song".into()), style: ButtonStyle::Link, url: Some(url.into()), sku_id: None }; let mut listen = button("fm:listen", "Listen to song", ButtonStyle::Primary); diff --git a/src/emojis.rs b/src/emojis.rs index 4adeb82..96f1f50 100644 --- a/src/emojis.rs +++ b/src/emojis.rs @@ -11,10 +11,10 @@ use twilight_model::id::marker::EmojiMarker; use twilight_model::id::Id; /// The plain emoji the code uses, and the icon that replaces it. -const ICONS: [(&str, &str); 30] = [ +const ICONS: [(&str, &str); 31] = [ ("▶️", "play"), ("⏸️", "pause"), ("⏭️", "skip"), ("⏹️", "stop"), ("🔁", "repeat"), ("🔂", "repeat_one"), ("🔀", "shuffle"), ("📜", "queue"), ("🔉", "vol_down"), ("🔊", "vol_up"), ("🔗", "link"), ("👋", "leave"), ("👑", "heads"), ("🦅", "tails"), ("🃏", "hit"), ("✋", "stand"), ("✖️", "double"), ("🎰", "spin"), ("🔄", "spin"), ("🔴", "red"), ("⚫", "black"), ("🟢", "green"), - ("🪙", "coin"), ("✅", "check"), ("❌", "cross"), ("⬆️", "up"), ("⬇️", "down"), ("🏳️", "flag"), ("🚩", "flag"), ("💰", "coin"), + ("🪙", "coin"), ("✅", "check"), ("❌", "cross"), ("⬆️", "up"), ("⬇️", "down"), ("🏳️", "flag"), ("🚩", "flag"), ("💰", "coin"), ("⏮️", "previous"), ]; fn uploaded() -> &'static RwLock>> {