From 5270c3a3abcc5f9fec2695804e005299d5badaf7 Mon Sep 17 00:00:00 2001 From: Klayton Smith II Date: Wed, 21 Sep 2022 12:05:03 -0400 Subject: [PATCH 1/6] made unique dbus names default behavior --- src/dbus_mpris.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dbus_mpris.rs b/src/dbus_mpris.rs index 66a8a68d..98bc7677 100644 --- a/src/dbus_mpris.rs +++ b/src/dbus_mpris.rs @@ -166,7 +166,8 @@ async fn create_dbus_server( // TODO: The first `true` allows us to replace orphaned dbus servers from previous sessions // later. We should instead properly release the name when the session ends. - conn.request_name("org.mpris.MediaPlayer2.spotifyd", true, true, true) + let path = format!("org.mpris.MediaPlayer2.spotifyd.instance{b}", b = std::process::id()); + conn.request_name(path, true, true, true) .await .expect("Failed to register dbus player name"); From 19176c3fe63f93d13e17f0682044cd1eb7e00385 Mon Sep 17 00:00:00 2001 From: Klayton Smith II Date: Wed, 21 Sep 2022 12:08:53 -0400 Subject: [PATCH 2/6] ran cargo fmt --- src/dbus_mpris.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/dbus_mpris.rs b/src/dbus_mpris.rs index 98bc7677..0c45f85e 100644 --- a/src/dbus_mpris.rs +++ b/src/dbus_mpris.rs @@ -166,7 +166,10 @@ async fn create_dbus_server( // TODO: The first `true` allows us to replace orphaned dbus servers from previous sessions // later. We should instead properly release the name when the session ends. - let path = format!("org.mpris.MediaPlayer2.spotifyd.instance{b}", b = std::process::id()); + let path = format!( + "org.mpris.MediaPlayer2.spotifyd.instance{b}", + b = std::process::id() + ); conn.request_name(path, true, true, true) .await .expect("Failed to register dbus player name"); From 5347ae39ce39d083f1330c8ac158292d3a64416c Mon Sep 17 00:00:00 2001 From: Klayton Smith II Date: Wed, 21 Sep 2022 14:54:15 -0400 Subject: [PATCH 3/6] made suggested change --- src/dbus_mpris.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dbus_mpris.rs b/src/dbus_mpris.rs index 0c45f85e..a55bae62 100644 --- a/src/dbus_mpris.rs +++ b/src/dbus_mpris.rs @@ -167,8 +167,8 @@ async fn create_dbus_server( // TODO: The first `true` allows us to replace orphaned dbus servers from previous sessions // later. We should instead properly release the name when the session ends. let path = format!( - "org.mpris.MediaPlayer2.spotifyd.instance{b}", - b = std::process::id() + "org.mpris.MediaPlayer2.spotifyd.instance{}", + std::process::id() ); conn.request_name(path, true, true, true) .await From f1f549084dd8e78132ba4006d9aea73e44236c4e Mon Sep 17 00:00:00 2001 From: Klayton Smith II Date: Mon, 26 Sep 2022 15:11:05 -0400 Subject: [PATCH 4/6] moved comment --- src/dbus_mpris.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dbus_mpris.rs b/src/dbus_mpris.rs index a55bae62..6dc8c2eb 100644 --- a/src/dbus_mpris.rs +++ b/src/dbus_mpris.rs @@ -164,12 +164,12 @@ async fn create_dbus_server( panic!("Lost connection to D-Bus: {}", err); }); - // TODO: The first `true` allows us to replace orphaned dbus servers from previous sessions - // later. We should instead properly release the name when the session ends. let path = format!( "org.mpris.MediaPlayer2.spotifyd.instance{}", std::process::id() ); + // TODO: The first `true` allows us to replace orphaned dbus servers from previous sessions + // later. We should instead properly release the name when the session ends. conn.request_name(path, true, true, true) .await .expect("Failed to register dbus player name"); From 6fc06bc163825da587ed2f85c4521ef38226d463 Mon Sep 17 00:00:00 2001 From: Klayton Smith II Date: Mon, 26 Sep 2022 15:11:51 -0400 Subject: [PATCH 5/6] moved comment --- src/dbus_mpris.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dbus_mpris.rs b/src/dbus_mpris.rs index 6dc8c2eb..43d2366f 100644 --- a/src/dbus_mpris.rs +++ b/src/dbus_mpris.rs @@ -168,6 +168,7 @@ async fn create_dbus_server( "org.mpris.MediaPlayer2.spotifyd.instance{}", std::process::id() ); + // TODO: The first `true` allows us to replace orphaned dbus servers from previous sessions // later. We should instead properly release the name when the session ends. conn.request_name(path, true, true, true) From cf1ba4f54bc5fbaa74cd7e57080eb2511713575b Mon Sep 17 00:00:00 2001 From: Klayton Smith II Date: Mon, 26 Sep 2022 15:37:44 -0400 Subject: [PATCH 6/6] ran cargo fmt --- src/dbus_mpris.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dbus_mpris.rs b/src/dbus_mpris.rs index 43d2366f..7187d0bb 100644 --- a/src/dbus_mpris.rs +++ b/src/dbus_mpris.rs @@ -168,7 +168,7 @@ async fn create_dbus_server( "org.mpris.MediaPlayer2.spotifyd.instance{}", std::process::id() ); - + // TODO: The first `true` allows us to replace orphaned dbus servers from previous sessions // later. We should instead properly release the name when the session ends. conn.request_name(path, true, true, true)