Lautaro-Garcia / counsel-spotify

Control Spotify App through Emacs
GNU General Public License v3.0
59 stars 8 forks source link

Dbus calls not working #2

Closed WhichMatt closed 5 years ago

WhichMatt commented 6 years ago

I had an issue while testing this package on Debian. The API calls would work fine, but when sending the commands through dbus, I would get the message:

dbus[4105]: arguments to dbus_message_new_method_call() were incorrect, assertion "_dbus_check_is_valid_member (method)" failed in file ../../../dbus/dbus-message.c line 1369.
This is normally a bug in some application using the D-Bus library.

  D-Bus not built with -rdynamic so unable to print a backtrace

I found that the function counsel-spotify-format-play-linux used format to supply the uri. Unfortunately, the escaping of " wasn't working on my computer ((format "OpenUri \"string:%s\"" "test") would return OpenUri \"string:test\" instead of OpenUri "string:test")

Testing with the change

(defun counsel-spotify-format-play-linux (uri)
  "Tell Spotify app to play the given URI."
  (format "OpenUri 'string:%s'" uri))

appears to work fine.

Software Version
counsel-spotify 20170612.1132
emacs 25.2.2
D-Bus 1.12.6
Lautaro-Garcia commented 6 years ago

Sorry for the delay. You're absolutely right, that Dbus call is not working and the one you suggested does the job well. I was running a patched version of this package and didn't remember :disappointed:

I was reading a lot about CLOS in the past time, so I ported this package to EIEIO (sort of the Emacs Lisp version of CLOS). In this port, the fix you propose is implemented and some new features are coming to life!

I already pushed it into this repo, please give it a try and tell me if all things work well!

Thank you very much