Giter Club home page Giter Club logo

Comments (6)

SnootierMoon avatar SnootierMoon commented on June 7, 2024 6

Hi, I'm new to Github and Emacs so let me know if I'm doing anything wrong by posting this here.

I was running in to a similar error, and I managed to fix it.

I found out that the program was failing to authenticate in the first url-retrieve call. After doing a bit of debugging, I realized that the counsel-spotify-basic-auth-credentials call in counsel-spotify-with-auth-token wasn't updating after I set the client ID and secret. Since the authentication doesn't work, everything would break, and I would get 0 results in the search buffer. When I press enter, I would get the cl-no-applicable-method error. However, when I remove the comma that comes before it, the entire thing works perfectly.

Is there any reason why the comma is there? As I understand it, removing the comma will just mean that counsel-spotify-basic-auth-credentials gets called again every time the counsel-spotify-with-auth-token macro is called. To be honest, I don't really understand how this kind of macro works, but removing the comma seems to work for me.

Thanks a lot for this plugin btw, I really love it :)

from counsel-spotify.

Lautaro-Garcia avatar Lautaro-Garcia commented on June 7, 2024 2

Oh, you're totally right!
The credentials were loaded on macro-expansion time and then counsel-spotify would no longer update them! Thank you for taking the time to debug this. I'll try to replicate the case that you're mentioning, commit the fix that you're proposing and hopefully have a version with this fix on MELPA in a couple of days.

PS: You did everything right, thank you very much!

from counsel-spotify.

Lautaro-Garcia avatar Lautaro-Garcia commented on June 7, 2024

Hello! It seems somehow related with issue #12, the error seems to be the same.

The offending function is counsel-spotify-do-play as it was asked to play nil (this is what I can interpret from the error above).
My question to you is, are you able to see the list of results, or the error pops up before you can even see them? Because that function only gets called when you actually want to play a thing (a song, an album, an artist or a playlist).

I'm worried that, in a way, the Spotify API response has changed somehting slightly and counsel-spotify isn't able to parse it quite right, so it ends up with a nil as a thing to play.
Another thing that could have changed is ivy, and the selection of an item is returning an empty thing, could you tell me what version of ivy are you currently using?

Thank you!

from counsel-spotify.

karthink avatar karthink commented on June 7, 2024

from counsel-spotify.

Lautaro-Garcia avatar Lautaro-Garcia commented on June 7, 2024

Sorry fo the delay, I can't seem to reproduce this case.
I am looking at the code back and forth, but am not seeing a place where the function counsel-spotify-do-play is called before an ivy action is fired up.

Reading your issue description again, I noticed that I'm running an older version of Emacs (everything else is the same, I'm assuming you have the latest version of counsel-spotify). I will try this updating Emacs to see if I can reproduce this bug.

A quick hack you could use, as I keep in my quest of finding this bug is actually defining a method for nil that does nothing

(cl-defmethod counsel-spotify-do-play ((backend counsel-spotify-linux-backend) (something (eql nil)))
  nil)

at least with this defined you'll be able to keep using counsel-spotify in the meantime.

Thank you for your patience!

from counsel-spotify.

Lautaro-Garcia avatar Lautaro-Garcia commented on June 7, 2024

Well, yesterday I uploaded a new version with the change that you proposed, please tell me if the issue you were mentioning is fixed!

from counsel-spotify.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.