Some Artists Simply Won't Load

10 views
Skip to first unread message

Gregory Smith

unread,
May 18, 2013, 2:44:47 PM5/18/13
to ruby-...@googlegroups.com
Hey everyone,

I'm new to Hallon and for the most part things are working great.  I have come across an issue where some artists simply won't load.  It seems like it's a small subset, say out of a playlist of 40 tracks, I found 4-5.

Some examples include:

spotify:artist:0YrtvWJMgSdVrk3SfNjTbx | Death Cab for Cutie
spotify:artist:3DiDSECUqqY1AuBP8qtaIa | Alicia Keys

Can anyone verify that they are able to load these artists?  I have checked and double checked the URIs are correct.  I've blasted my local Hallon cache in my project's /tmp/ directory.  Is there anywhere else there may be cached data that could be causing this or is this an issue with some combination of libspotify/Hallon?

Even having verification that others can load these artists would be a huge help as I try to debug this.

Thanks in advance

Kim Burgestrand

unread,
May 18, 2013, 7:33:48 PM5/18/13
to Hallon on behalf of Gregory Smith
On Saturday, 18 May 2013 at 20:44, Gregory Smith via Hallon wrote:
Hey everyone,

I'm new to Hallon and for the most part things are working great.  I have come across an issue where some artists simply won't load.  It seems like it's a small subset, say out of a playlist of 40 tracks, I found 4-5.
This happens sometimes.

libspotify makes no guarantee that an object will ever load. It’s not at all uncommon that an object takes over 30 seconds to load, or never loads at all. This may seem strange at first, but considering libspotify is built for a GUI environment, where objects are simply available until they’re loaded, it’s usually not a big deal if a track doesn’t load in this environment.

I’ve been told this is simply how libspotify behaves, and the reason is because the backend might have (at times) problems with specific tasks. These issues are usually resolved after a while, so trying another day might even fix the problem! I’m not aware of any way to work around this, or how to make libspotify more reliable.

It might even be the case that if you try to load unavailable objects from another account or from within another country it’ll work just fine.

Some examples include:

spotify:artist:0YrtvWJMgSdVrk3SfNjTbx | Death Cab for Cutie
spotify:artist:3DiDSECUqqY1AuBP8qtaIa | Alicia Keys

Can anyone verify that they are able to load these artists?  I have checked and double checked the URIs are correct.  I've blasted my local Hallon cache in my project's /tmp/ directory.  Is there anywhere else there may be cached data that could be causing this or is this an issue with some combination of libspotify/Hallon?

Even having verification that others can load these artists would be a huge help as I try to debug this.
I had no issues loading these.

— Kim Burgestrand 

Gregory Smith

unread,
May 19, 2013, 12:37:43 AM5/19/13
to Hallon on behalf of Kim Burgestrand
Kim -- hugely appreciate you getting back to me so quickly and thanks for putting together a great library.

I messed around with the Cocoa version of libspotify, and picked through some of the examples.  From what I saw, it didn't have any issues loading artists/tracks.  The amount of time I spent wasn't extensive, so I can't say definitively that it is immune to what I'm experiencing, but are some versions of libspotify more stable?  Is the Darwin version less reliable for some reason?  

Just out of curiosity have you (or anyone else) used any of the other libspotify wrapper projects pyspotify/libjahspotify?  Do these other libraries experience this as well?

Maybe it's my lack of understanding of how libspotify works, but "the backend having problems with specific tasks," when the task is as simple as loading 1 in 10 or 1 in 20 artists is a relatively big deal.  Based on your conversations, your understanding is that they are happy with this level of reliability for developers?  It makes it very difficult to justify building something more than a pet project with their API if breakage is a constant concern.

Thanks again for helping me understand :D sorry if I come across as being grumpy!  I mainly just want to be able to build on top of this API and not have to dig through C (which I haven't done anything with in about 5 years).




--
You received this message because you are subscribed to the Hallon ruby gem mailing list.

- To view this group online, visit https://groups.google.com/d/forum/ruby-hallon
- To post to this group, send email to ruby-...@googlegroups.com
- To unsubscribe from this group, send email to ruby-hallon...@googlegroups.com
---
You received this message because you are subscribed to a topic in the Google Groups "Hallon" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ruby-hallon/UtUY2JmWa3U/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to ruby-hallon...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Gregory Smith

unread,
May 19, 2013, 1:48:39 AM5/19/13
to Hallon on behalf of Kim Burgestrand
I did some additional testing and I want to point out something strange I noticed:

# Trying to load Death Cab for Cutie
# Results in a Hallon::Timeout every time and I've tried about 50 today
artist = Hallon::Artist.new("spotify:artist:0YrtvWJMgSdVrk3SfNjTbx").load
###

# Trying to load a track BY Death Cab for Cutie
# Track loads, artist , and URI matches above
track = Hallon::Track.new("spotify:track:2tsKfVNqn4vviL0uYTPxXf").load
p track.artists.first.to_link.to_str
#####

I realize that calling Track loads the artists too, but I still think that it's interesting to see that if you take a slightly different route you can get the artist.

Kim Burgestrand

unread,
May 19, 2013, 10:35:55 AM5/19/13
to Hallon on behalf of Gregory Smith
On Sunday, 19 May 2013 at 07:48, Hallon on behalf of Gregory Smith wrote:
I did some additional testing and I want to point out something strange I noticed:

# Trying to load Death Cab for Cutie
# Results in a Hallon::Timeout every time and I've tried about 50 today
artist = Hallon::Artist.new("spotify:artist:0YrtvWJMgSdVrk3SfNjTbx").load
###

# Trying to load a track BY Death Cab for Cutie
# Track loads, artist , and URI matches above
track = Hallon::Track.new("spotify:track:2tsKfVNqn4vviL0uYTPxXf").load
p track.artists.first.to_link.to_str
#####

I realize that calling Track loads the artists too, but I still think that it's interesting to see that if you take a slightly different route you can get the artist.
What Hallon does when you call `#load` on an object is a few very simple steps:

1. Check if the object is loaded (`loaded?` returns true), if so it returns the object.
2. Call Session#process_events (i.e. allow libspotify to work off it’s internal event queue).
3. Sleep a little while.
4. Repeat from #1.

There’s not many steps to perform when loading an object, and most of it relies on libspotify. Hallon doesn’t do anything special in this regard.
 
I wrote some code using the raw spotify gem [1], and loaded it up in a pry session, and I found something interesting. It appears artists will *never* load if they are the first thing you try to load. However, if you create a link for a track (it doesn’t even have to *create* a track, just making a link for it is fine), it will allow the artist to load. It feels very much like a bug in libspotify, and I have a vague memory of hearing of this bug in the past.


— Kim Burgestrand
Reply all
Reply to author
Forward
0 new messages