From d0acf77f88ae9854be29565f931b35acc124ac07 Mon Sep 17 00:00:00 2001 From: DaXcess Date: Mon, 19 Aug 2024 12:34:51 +0200 Subject: [PATCH] Fix lpq --- CHANGELOG.md | 1 + Dockerfile | 2 +- spoticord_session/src/playback_embed.rs | 18 +++++++++--------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e06cb0d..d20c576 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## 2.2.1 | TBD - Added new option: `/playing` can now receive an updating behavior parameter +- Added album name to `/playing` embed - Fixed a bug where uncached guilds would panic the bot - Fixed small issue with embed styling - Updated to Rust 1.80.1 (from 1.79.0) diff --git a/Dockerfile b/Dockerfile index 24df520..89e7cb5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ WORKDIR /app # Add extra build dependencies here RUN apt-get update && apt-get install -yqq \ - cmake gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu + cmake gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu libpq-dev COPY . . diff --git a/spoticord_session/src/playback_embed.rs b/spoticord_session/src/playback_embed.rs index 1c38482..a6f74f8 100644 --- a/spoticord_session/src/playback_embed.rs +++ b/spoticord_session/src/playback_embed.rs @@ -407,23 +407,23 @@ fn build_embed(playback_info: &PlaybackInfo, owner: &User) -> CreateEmbed { } if let Some(album_name) = playback_info.album_name() { - description += &format!("In album: **{album_name}**\n\n"); - } else { - description += "\n"; + description += &format!("Album: **{album_name}**\n"); } if let Some(show_name) = playback_info.show_name() { - description += &format!("On {show_name}\n\n"); + description += &format!("On {show_name}\n"); } + description += "\n"; + let position = playback_info.current_position(); let index = position * 20 / playback_info.duration(); - description.push_str(if playback_info.playing() { + description += if playback_info.playing() { "▶️ " } else { "⏸️ " - }); + }; for i in 0..20 { if i == index { @@ -433,12 +433,12 @@ fn build_embed(playback_info: &PlaybackInfo, owner: &User) -> CreateEmbed { } } - description.push_str("\n:alarm_clock: "); - description.push_str(&format!( + description += "\n:alarm_clock: "; + description += &format!( "{} / {}", spoticord_utils::time_to_string(position / 1000), spoticord_utils::time_to_string(playback_info.duration() / 1000) - )); + ); CreateEmbed::new() .author(