diff options
Diffstat (limited to 'src/sources/dbus.rs')
| -rw-r--r-- | src/sources/dbus.rs | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/sources/dbus.rs b/src/sources/dbus.rs index 57c5853..2f6bccd 100644 --- a/src/sources/dbus.rs +++ b/src/sources/dbus.rs @@ -1,5 +1,5 @@ -use std::io::Result; use mpris::PlayerFinder; +use std::io::Result; use crate::Track; @@ -14,24 +14,19 @@ impl Dbus { } impl LyricsSource for Dbus { - fn name(&self) -> String { "dbus".to_string() } fn current_track(&self) -> Option<Track> { - let player = PlayerFinder::new().ok()? - .find_active().ok()?; + let player = PlayerFinder::new().ok()?.find_active().ok()?; let metadata = player.get_metadata().ok()?; let name = metadata.title()?.to_string(); let artists = metadata.artists()?; let artist = artists.get(0)?.to_string(); - Some(Track { - name, - artist - }) + Some(Track { name, artist }) } fn disable(&self) -> Result<()> { |