diff --git a/scrob-core/src/player/player_windows.rs b/scrob-core/src/player/player_windows.rs index 2389b01..3754cec 100644 --- a/scrob-core/src/player/player_windows.rs +++ b/scrob-core/src/player/player_windows.rs @@ -6,7 +6,7 @@ use std::time::Duration; use std::time::SystemTime; use windows::Media::Control::GlobalSystemMediaTransportControlsSessionManager as MediaManager; use windows::Media::Control::GlobalSystemMediaTransportControlsSessionPlaybackStatus as MediaStatus; -use windows::Media::MediaTimelineController; + /// Uses the winrt api to get access the media player data. pub fn get_current_song() -> Result { @@ -54,8 +54,10 @@ pub fn get_current_song() -> Result { } let mut source = Players::GenericMusicPlayer; + let mut app_id = ""; if let Ok(origin) = current_session.SourceAppUserModelId() { let origin = origin.to_string(); + app_id = origin; trace!("Detected song from '{}'", origin); if origin.starts_with("Microsoft.ZuneMusic") { source = Players::GrooveMusic @@ -73,6 +75,7 @@ pub fn get_current_song() -> Result { .expect("Failed to unwrap song metadata even if retrieval was successful."); let song = Song { + app_id: app_id, track: song_metadata .Title() .expect("Failed to retrieve title from song")