Skip to content

Commit

Permalink
Fixed minor bug with play/pause button
Browse files Browse the repository at this point in the history
  • Loading branch information
morosanmihail committed Jan 16, 2025
1 parent d64c632 commit db02b47
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/homeassistant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub struct MediaPlayerState {
pub entity_id: String,
}

#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct MediaPlayerMetadata {
pub title: String,
pub artist: String,
Expand All @@ -39,7 +39,7 @@ pub struct MediaPlayerMetadata {
pub repeat: HALoopStatus,
}

#[derive(Debug)]
#[derive(Debug, Clone)]
pub enum HALoopStatus {
None,
Track,
Expand Down
6 changes: 3 additions & 3 deletions src/mpris.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,8 @@ pub async fn new_mpris_player(
.properties_changed([
Property::Metadata(
Metadata::builder()
.title(metadata_update.title)
.artist(vec![metadata_update.artist])
.title(&metadata_update.title)
.artist(vec![&metadata_update.artist])
.length(Time::from_secs(metadata_update.duration))
.art_url(
metadata_update.art_url.trim_matches(['\"']).to_string(),
Expand All @@ -315,7 +315,7 @@ pub async fn new_mpris_player(
.await?;
{
let mut metadata = metadata_lock.lock().await;
metadata.position = metadata_update.position;
*metadata = metadata_update.clone();
}
}
_ => {}
Expand Down

0 comments on commit db02b47

Please sign in to comment.