This repository was archived by the owner on Aug 5, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -632,6 +632,25 @@ async fn handle_connection_event(
632632 }
633633 }
634634
635+ let incoming_title = update
636+ . media_item
637+ . as_ref ( )
638+ . and_then ( |m| m. title . as_ref ( ) )
639+ . map ( |t| t. trim ( ) . to_string ( ) ) ;
640+ let title_changed = match ( & incoming_title, & now_playing_state. title ) {
641+ ( Some ( new_title) , Some ( old_title) ) => {
642+ !new_title. is_empty ( ) && new_title != old_title. trim ( )
643+ }
644+ _ => false ,
645+ } ;
646+
647+ if title_changed {
648+ now_playing_state. album = None ;
649+ now_playing_state. duration_ms = None ;
650+ now_playing_state. app_name = None ;
651+ now_playing_state. elapsed_ms = None ;
652+ }
653+
635654 if let Some ( ref media) = update. media_item {
636655 if let Some ( ref title) = media. title {
637656 now_playing_state. title = Some ( title. clone ( ) ) ;
You can’t perform that action at this time.
0 commit comments