New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sp_album_cover implemented #24
Conversation
Thank you very much for contributing. I'll run this on my installation when Florent
|
So ive been reading in more detail. the doc says about images "If an image is loaded, and loading fails, the image will behave like an empty image." |
my first intention was that the buffer is empty, yes. (implemented it this way in my project https://github.com/swissmanu/kaffeeundkuchen/blob/master/src/api/coverimage.js#L42) in that case we wouldn't have any proper chance to check if the image was actually loaded or not i guess. |
I don't know. Should we consider an unloaded image as an error and treat it as such ? |
if we'd reflect libspotifys own behaviour, i guess we should not. what's your opinion on extending
-- UPDATE --
|
Please, please, please use the "more nodejs way", e.g. |
hi florent
following pull request contains the implementation of
sp_album_cover
for the album object.it adds the following methods to the album object:
coverImage(cb)
smallCoverImage(cb)
largeCoverImage(cb)
each of them expects a function callback which will be called as soon as the cover image is loaded. the images raw data will be contained in the first function argument, represented inside a
Buffer
:a unit test is included and should run successfully. further i allowed myself to update your package.json with the minimum requirement of node.js 0.10.0 since
node-libspotify
needs the new stream implementations.please let me know if you want some modifications/improvements on the code. otherwise i'd be happy if you can use my addition to bring node-libspotify one step closer to completion.
cheers,
manu