From ee8ac99d9fa1f348065108b73297eebc8033e57e Mon Sep 17 00:00:00 2001 From: Ruben Beltran del Rio Date: Thu, 17 Jul 2025 15:31:38 +0200 Subject: Use objc2, rename dbus to mpris, add swinsian --- src/sources/dbus.rs | 43 ------------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 src/sources/dbus.rs (limited to 'src/sources/dbus.rs') diff --git a/src/sources/dbus.rs b/src/sources/dbus.rs deleted file mode 100644 index 2f6bccd..0000000 --- a/src/sources/dbus.rs +++ /dev/null @@ -1,43 +0,0 @@ -use mpris::PlayerFinder; -use std::io::Result; - -use crate::Track; - -use super::LyricsSource; - -pub struct Dbus; - -impl Dbus { - pub fn new() -> Self { - 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 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 }) - } - - fn disable(&self) -> Result<()> { - Ok(()) - } - - fn enable(&self) -> Result<()> { - Ok(()) - } - - fn reset(&self) -> Result<()> { - Ok(()) - } -} -- cgit