Hallon icon indicating copy to clipboard operation
Hallon copied to clipboard

Hallon::Session.initialize IO.read('./spotify_appkey.key') causes server to crash every time it's run

Open ghost opened this issue 9 years ago • 3 comments

I'm having trouble with Hallon::Session

It's causing my rails server to crash everytime I try to run my index controller (code below) (so I need to run rails s) to get it back up.

class IndexController < ApplicationController
    def index
      require 'hallon'
  session = Hallon::Session.initialize IO.read('./spotify_appkey.key')
  session.login!('myusername', 'mypassword')
    end
end

This is on a clean project - I've run 'rails new myapp' and 'gem install hallon' and that's it.

No errors at all, server stops and I get a connection refused message in my browser. Does anyone know why this is happening?

ghost avatar Jul 14 '15 08:07 ghost

Hi! A few quick points, and then a question.

  • Hallon is currently not being maintained.
  • libspotify (which Hallon uses) is deprecated by Spotify, (https://developer.spotify.com/technologies/libspotify/) which means that Spotify for Ruby gem is also deprecated.
  • For most uses, Spotify web api is sufficient and much easier to use: https://developer.spotify.com/web-api/

In light of this, do you really still want to use Hallon?

Burgestrand avatar Jul 14 '15 17:07 Burgestrand

Hi

Reading those points, probably not - but it was something to play with as I learned to use Rails - and there doesn’t seem to be another way to create a Spotify jukebox with web frontend.

From: Kim Burgestrand [mailto:[email protected]] Sent: 14 July 2015 18:38 To: Burgestrand/Hallon Cc: Stephen Subject: Re: [Hallon] Hallon::Session.initialize IO.read('./spotify_appkey.key') causes server to crash every time it's run (#152)

Hi! A few quick points, and then a question.

  • Hallon is currently not being maintained.
  • libspotify (which Hallon uses) is deprecated by Spotify, (https://developer.spotify.com/technologies/libspotify/) which means that Spotify for Ruby gem is also deprecated.
  • For most uses, Spotify web api is sufficient and much easier to use: https://developer.spotify.com/web-api/

In light of this, do you really still want to use Hallon?

— Reply to this email directly or view it on GitHub https://github.com/Burgestrand/Hallon/issues/152#issuecomment-121318376 . https://github.com/notifications/beacon/AGOVNz8P2mdn_mAKzzhTNj-Kwk0y4iRVks5odUCSgaJpZM4FYDwP.gif

ghost avatar Jul 15 '15 10:07 ghost

Hi!

That is correct, as far as I know the only gem that allows you to play music from Spotify in Ruby is the Spotify gem.

That said, if you still want to go down this path in Ruby I would suggest you use the Spotify gem instead (https://github.com/Burgestrand/spotify), which I am also the author of. Hallon is much more unstable, and I'm not surprised that it causes very weird behavior.

I also know that the Spotify client starts up a local webserver on the computer it is running on, which allows some remote control. If you run your jukebox and web front end on the same machine, it's possible it might be easier to control playback through those means instead of writing your own music player.

Burgestrand avatar Jul 20 '15 11:07 Burgestrand