diff --git a/remote/mpris2.go b/remote/mpris2.go index 415251e..b8af265 100644 --- a/remote/mpris2.go +++ b/remote/mpris2.go @@ -6,7 +6,6 @@ package remote import ( "errors" "math" - "strings" "github.com/godbus/dbus/v5" "github.com/godbus/dbus/v5/introspect" @@ -26,8 +25,6 @@ func RegisterMprisPlayer(player ControlledPlayer, logger_ logger.LoggerInterface return } - parts := []string{"", "org", "mpris", "MediaPlayer2", "stmps"} - name := strings.Join(parts[1:], ".") mpp = &MprisPlayer{ dbus: conn, player: player, @@ -104,7 +101,7 @@ func RegisterMprisPlayer(player ControlledPlayer, logger_ logger.LoggerInterface { Name: "org.mpris.MediaPlayer2.Player", Methods: introspect.Methods(mpp), - Properties: props.Introspection("org.mpris.MediaPlayer2.stmps"), + Properties: props.Introspection("org.mpris.MediaPlayer2.Player"), // we implement the standard interface }, }, } @@ -113,6 +110,8 @@ func RegisterMprisPlayer(player ControlledPlayer, logger_ logger.LoggerInterface return } + // our unique name + name := "org.mpris.MediaPlayer2.stmps" reply, err := conn.RequestName(name, dbus.NameFlagDoNotQueue) if err != nil { return