Skip to content

Commit

Permalink
fix interface name in introspection
Browse files Browse the repository at this point in the history
  • Loading branch information
spezifisch committed Aug 5, 2024
1 parent ffabbdd commit d483815
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions remote/mpris2.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package remote
import (
"errors"
"math"
"strings"

"github.com/godbus/dbus/v5"
"github.com/godbus/dbus/v5/introspect"
Expand All @@ -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,
Expand Down Expand Up @@ -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
},
},
}
Expand All @@ -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
Expand Down

0 comments on commit d483815

Please sign in to comment.