Burgestrand / spotify

Low-level Ruby bindings for libspotify, the official Spotify C API
https://rubygems.org/gems/spotify
Other
147 stars 17 forks source link

Album information won't load #34

Closed alexanderadam closed 8 years ago

alexanderadam commented 8 years ago

Hi @Burgestrand,

I contacted you already about this issue but it is probably better to open it directly here on github. :wink:

Here you can find a gist which outlines the problem. Getting information about a track always work but getting information about an album never works for me.

It would be wonderful if you or someone else has an idea what the problem could be.

And thank you very much for this gem.

Burgestrand commented 8 years ago

Have you tried with another album URL? spotify:album:2p3I85xNLOMg1z4h8GCp5k worked fine for me to load, while your example album URL did not ever appear to load.

I can't say I understand why it won't load, but libspotify is deprecated, so there could be various reasons and one could be that that particular album contains something that libspotify does not know how to handle.

Burgestrand commented 8 years ago

Here's a fun fix for you that worked for me: create an album browse object, right after you create your album, like so:

# …
album = Spotify.link_as_album(link)
browse = Spotify.albumbrowse_create(session, album, nil, nil)
# …

Just ignore this browse object, for me the album now loads every time. Don't you just love old and unmaintained C libraries? :)

alexanderadam commented 8 years ago

Isn't it late now in Sweden too? :sleeping:

Yes, I collect old unmaintained libraries like other people collect old cars. (No, just a legacy project and it always bothered me why it wont work.) :wink:

I choosed the album just because of the name (searched for an album that is "broken" and a track that "works"). :musical_note:

Well that was the solution actually. :tada:

I also got the browse object later on but if I get it before I look for a loaded album everything runs fine.

Thank you for this! :open_hands: From now on I will sleep better. :wink: Really. You are awesome!

PS: Which library would you recommend instead, if not yours? RSpotify?

Burgestrand commented 8 years ago

Nice! Well, mine is the best one if you want to use libspotify, especially if you want any chance of playing full-length music from Spotify you don't really have a choice in Ruby.

In the past libspotify had a lot of functionality that the Spotify Web API did not have; that has been changing and soon (if not already) the Web API will have all the functionality of libspotify, and maybe eventually full-length music possibilities. If you can get away with using the Web API for your purposes I would advice you to do that, and that probably means using RSpotify or other wrappers specifically for the Web API. :)

alexanderadam commented 8 years ago

Thank you for your insights. :+1: