X-Git-Url: https://git.r.bdr.sh/rbdr/lyricli/blobdiff_plain/040b91a7a5b085f8aa0bec3580bf7d68450e6fc9..caee5d1375cb0680b4ccec0d760b73a6fee460b4:/src/sources/dbus.rs?ds=inline 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 { - 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<()> {