diff --git a/Cargo.toml b/Cargo.toml index a779ffb..0f90848 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,6 +24,7 @@ leptos_icons = { version = "0.1.0", default_features = false, features = [ "BsSkipStartFill", "BsSkipEndFill", "RiPlayListMediaFill", + "BsTrashFill", ] } dotenv = { version = "0.15.0", optional = true } diesel = { version = "2.1.4", features = ["postgres", "r2d2"], optional = true } diff --git a/src/playbar.rs b/src/playbar.rs index f0a85aa..7f72b04 100644 --- a/src/playbar.rs +++ b/src/playbar.rs @@ -36,7 +36,7 @@ const ARROW_KEY_SKIP_TIME: f64 = 5.0; /// * `None` if the audio element is not available /// * `Some((current_time, duration))` if the audio element is available /// -fn get_song_time_duration(status: impl SignalWithUntracked) -> Option<(f64, f64)> { +pub fn get_song_time_duration(status: impl SignalWithUntracked) -> Option<(f64, f64)> { status.with_untracked(|status| { if let Some(audio) = status.get_audio() { Some((audio.current_time(), audio.duration())) @@ -57,7 +57,7 @@ fn get_song_time_duration(status: impl SignalWithUntracked) /// * `status` - The `PlayStatus` to get the audio element from, as a signal /// * `time` - The time to skip to, in seconds /// -fn skip_to(status: impl SignalUpdate, time: f64) { +pub fn skip_to(status: impl SignalUpdate, time: f64) { if time.is_infinite() || time.is_nan() { error!("Unable to skip to non-finite time: {}", time); return @@ -81,7 +81,7 @@ fn skip_to(status: impl SignalUpdate, time: f64) { /// * `status` - The `PlayStatus` to get the audio element from, as a signal /// * `play` - `true` to play the song, `false` to pause it /// -fn set_playing(status: impl SignalUpdate, play: bool) { +pub fn set_playing(status: impl SignalUpdate, play: bool) { status.update(|status| { if let Some(audio) = status.get_audio() { if play {