Make functions needed for queue public and add trash icon dependency

This commit is contained in:
Connor Wittman 2024-02-06 17:37:57 -05:00 committed by Ethan Girouard
parent 604e2c9c7f
commit b8d2fca0ee
Signed by: eta357
GPG Key ID: 7BCDC36DFD11C146
2 changed files with 4 additions and 3 deletions

View File

@ -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 }

View File

@ -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<Value = PlayStatus>) -> Option<(f64, f64)> {
pub fn get_song_time_duration(status: impl SignalWithUntracked<Value = PlayStatus>) -> 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<Value = PlayStatus>)
/// * `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<Value = PlayStatus>, time: f64) {
pub fn skip_to(status: impl SignalUpdate<Value = PlayStatus>, 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<Value = PlayStatus>, 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<Value = PlayStatus>, play: bool) {
pub fn set_playing(status: impl SignalUpdate<Value = PlayStatus>, play: bool) {
status.update(|status| {
if let Some(audio) = status.get_audio() {
if play {