Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

[WIP] Refactor and API Redesign #70

Open
wants to merge 109 commits into from

4 participants

@adammw
Collaborator

:construction:

Ref: #56

Loosely based off this design proposal.

:warning: Expect breaking changes :warning:

:pencil: comments welcome :pencil:

Classes

  • SpotifyUri
  • Connection
  •   Request
  •   Response
  •   HermesRequest
  •   HermesResponse
  • Metadata
  •   Album
  •   Artists
  •   Tracks
  •   PlaySession
  • Playlists
  •   Playlist
  •   PlaylistAttributes
  •   PlaylistChange
  •   PlaylistContents
  •   PlaylistItem
  •   PlaylistRevision
  • Radio
  • Users

TODOs / Wishlist

  • Move connection-related code to Connection class
  • Move request-related code to Request/HermesRequest/Response/HermesResponse class
  • Pluggable command handling API would be nice, otherwise eventemitter is fine, just have to not warn about unhandled events. (think think)
  • Request Queueing and auto-reconnection on disconnection (handle the 'disconnect' command)
  • Automatic subscribe / unsubscribe on Playlist events
  • Support playlist events
  • Make playlist class work with rootlists
  • Playlist add/move/delete methods
  • Remove old code from spotify.js
  • Support caching of Hermes calls
  • Work out how to share state between objects (e.g. two playlist instances for the same url shouldn't have to make two calls, two subscriptions, etc. - although subscriptions should have code to stop this being a real problem)
  • jslint / jshint
  • Backwards compatibility stubs
  • Remove debugging logspew
  • Test everything manually
  • Docs
  • Automated testing (e.g. Travis CI - would be nice, but is probably asking too much)
adammw added some commits
@adammw adammw Add Request / Response classes cce3a49
@adammw adammw Add HermesRequest / HermesResponse classes ac7c11e
@adammw adammw Move request / response classes to "connection" folder 42f0392
@adammw adammw Create Connection class to handle the WebSocket connection 0584a37
@adammw adammw error: move to connection folder 069b533
@adammw adammw connection: add missing event handlers ed2d245
@adammw adammw spotify: use SpotifyConnection eb3e5b7
@adammw adammw connection: fix typos 08312e9
@adammw adammw util: add export decorator 41610c9
@adammw adammw connection: use export decorator 417ec36
@adammw adammw request: handle multiple callbacks 3bba62f
@adammw adammw connection: separate sending request from flushing queue 3ede1a2
@adammw adammw connection: fix bugs preventing connection completing a95558b
@adammw adammw request: add missing require() 58cb89d
@adammw adammw Merge remote-tracking branch 'origin/ping_flash_2' into api-redesign
Conflicts:
	lib/spotify.js
035cb1b
@adammw adammw remove unintentionally committed file fc74bea
@adammw adammw request: add debugging call and fix hasCallback function 31dfafb
@adammw adammw connection: fix _startHeartbeat function 4872677
@adammw adammw connection: add debugging message for connect event b1153eb
@adammw adammw Add SpotifyUri class 8a2dc06
@adammw adammw util: use uri conversion functions from SpotifyUri 4304a67
@adammw adammw util: export what is exported by export() bae1392
@adammw adammw util: add caveat to export() function comment 6b4a547
@adammw adammw util: fix bug in export() acc006f
@adammw adammw util: more export tweaks fe3b313
@adammw adammw connection: specify $inject 6807948
@adammw adammw spotify: re-export all classes off SpotifyConnection with util.recurs…
…iveExport
2c6785c
@adammw adammw util: add warning about the order of calls for export() c43dc0d
@adammw adammw Move track, artist and album to metadata folder 3710b99
@adammw adammw metadata 7fcaf0c
@adammw adammw metadata: fixes 9ec08a7
@adammw adammw util: add missing bind() helper 597a78d
@adammw adammw spotify: export functions from SpotifyUri directly c0b44f2
@adammw adammw spotify: attach metadata multi get merger as request queue handler f09aaaa
@adammw adammw metadata: requestQueue is now on the connection 3a9e715
@adammw adammw spotify: add _objectify method 1b73d95
adammw added some commits
@adammw adammw added the wip label
@Techwraith

This looks amazing! I want!

This was referenced
@miklschmidt

I really hope you have time to finish this, i started using it because of the User prototype, and it works really well. I did run into the 403 forbidden issue while playing tracks though. Dno if it would've happened using master. Need to do some more testing.

Update: Looks like just hitting track.play() again after a 403 works fine.

JChapman202 and others added some commits
@JChapman202 JChapman202 Added Spotify.Web.App.initialize() noop Function
Recently Spotify Web started calling the initialize() function in the
authentication script which causes an exception to be thrown while
connecting node-spotify-web.  This NOOP operation allows authentication
to complete successfully.

Conflicts:
	lib/spotify.js
b65c445
@adammw adammw Add initial support for special playlists b78e3d7
@adammw adammw Add more supported types to Spotify#get d44c6a4
@adammw adammw Remove Spotify#playlist, modify Spotify#rootlist c618a70
@adammw adammw Emit errors from Playlist#_performDiff 943ab62
@adammw adammw Fix custom header field parsing fe2cc33
@adammw adammw Move rootlist method to User object fedf382
@adammw adammw Parse and cache playlist attributes on contents e195147
@adammw adammw Remove Spotify#similar
No longer needed now we have Track#similar
b9f5f39
@adammw adammw example: add playlistEvents
This example script demonstrates how to listen for events on the
playlist instance.
8d6f1ae
@adammw adammw user: add missing SpotifyUri require() c562504
@adammw adammw spotify: create User object on login 03bcc31
@adammw adammw user: fix typo in User#rootlist 3848063
@adammw adammw playlist: fix scope in Playlist#contents callback 1d69693
@adammw adammw user: use Spotify#get in User#rootlist a943558
@adammw adammw user: implement User#starred 8868c3c
@adammw adammw example: Update rootlist for new API 23dff23
@adammw adammw playlist: Make attributes optional upon creation dde084d
@adammw adammw playlist: Add method to update playlist attributes 84eb34b
@adammw adammw playlist-contents: set index and revision on items 0a76a3b
@adammw adammw playlist: set index and revision on diff items 8c1166a
@adammw adammw playlist: add Playlist#add method fa5bc9a
@adammw adammw playlist: add remove methods df5fc9b
@adammw adammw playlist: automatically add created to rootlist 584a8ce
Brandt Abbott spotify: new flash key, moved sp_log and sp_user_info commands after …
…login_complete

Squashed commit of the following:

commit 0498c45
Author: Brandt Abbott <brandt.abbott@readytalk.com>
Date:   Sat Apr 26 07:36:26 2014 -0600

    Issue #81 forgot to remove calls from _onconnect, it was late at night

commit 9268e2f
Author: Brandt Abbott <brandt.abbott@readytalk.com>
Date:   Fri Apr 25 23:25:48 2014 -0600

    Issue #81 - New flash key.  Moved sp_log and sp_user_info commands after login_complete

Fixes #81.
Closes #82.

Conflicts:
	lib/spotify.js
6a5e5e8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 14, 2014
  1. @adammw

    Add Request / Response classes

    adammw authored
  2. @adammw
  3. @adammw
  4. @adammw
  5. @adammw
  6. @adammw
  7. @adammw

    spotify: use SpotifyConnection

    adammw authored
  8. @adammw

    connection: fix typos

    adammw authored
  9. @adammw

    util: add export decorator

    adammw authored
  10. @adammw
  11. @adammw
  12. @adammw
  13. @adammw
  14. @adammw

    request: add missing require()

    adammw authored
  15. @adammw

    Merge remote-tracking branch 'origin/ping_flash_2' into api-redesign

    adammw authored
    Conflicts:
    	lib/spotify.js
  16. @adammw
  17. @adammw
  18. @adammw
  19. @adammw
  20. @adammw

    Add SpotifyUri class

    adammw authored
  21. @adammw
  22. @adammw
  23. @adammw
  24. @adammw

    util: fix bug in export()

    adammw authored
  25. @adammw

    util: more export tweaks

    adammw authored
  26. @adammw

    connection: specify $inject

    adammw authored
  27. @adammw
  28. @adammw
  29. @adammw
  30. @adammw

    metadata

    adammw authored
  31. @adammw

    metadata: fixes

    adammw authored
  32. @adammw

    util: add missing bind() helper

    adammw authored
  33. @adammw
  34. @adammw
  35. @adammw
  36. @adammw

    spotify: add _objectify method

    adammw authored
Commits on Feb 17, 2014
  1. @adammw
  2. @adammw
  3. @adammw

    spotify: fix syntax error

    adammw authored
  4. @adammw
  5. @adammw
  6. @adammw
  7. @adammw
  8. @adammw
  9. @adammw
  10. @adammw
  11. @adammw

    util: add deferCallback helper

    adammw authored
  12. @adammw

    uri: fix typo

    adammw authored
  13. @adammw
  14. @adammw

    uri: whitespace

    adammw authored
  15. @adammw

    play_session: specify `$inject`

    adammw authored
  16. @adammw
Commits on Feb 19, 2014
  1. @adammw

    spotify: fix get function

    adammw authored
  2. @adammw

    Add User class

    adammw authored
  3. @adammw
  4. @adammw

    spotify: add missing require()

    adammw authored
  5. @adammw
  6. @adammw
  7. @adammw
  8. @adammw

    track: fix Track#similar()

    adammw authored
  9. @adammw
  10. @adammw
  11. @adammw

    connection: add subscription

    adammw authored
Commits on Feb 20, 2014
  1. @adammw

    connection: fix typo

    adammw authored
Commits on Feb 21, 2014
  1. @adammw
  2. @adammw
  3. @adammw
  4. @adammw

    remove some logspew

    adammw authored
Commits on Feb 22, 2014
  1. @adammw
  2. @adammw

    metadata: remove logging

    adammw authored
  3. @adammw
Commits on Feb 24, 2014
  1. @adammw
Commits on Feb 25, 2014
  1. @adammw

    subscription tweaks

    adammw authored
  2. @adammw
  3. @adammw
  4. @adammw
  5. @adammw
Commits on Mar 7, 2014
  1. @adammw

    Expose playlist changes

    adammw authored
  2. @adammw

    playlist: bugfix

    adammw authored
Commits on Mar 10, 2014
  1. @adammw
  2. @adammw
  3. @adammw
  4. @adammw
  5. @adammw
Commits on Apr 18, 2014
  1. @JChapman202 @adammw

    Added Spotify.Web.App.initialize() noop Function

    JChapman202 authored adammw committed
    Recently Spotify Web started calling the initialize() function in the
    authentication script which causes an exception to be thrown while
    connecting node-spotify-web.  This NOOP operation allows authentication
    to complete successfully.
    
    Conflicts:
    	lib/spotify.js
  2. @adammw
  3. @adammw
  4. @adammw
  5. @adammw
  6. @adammw

    Fix custom header field parsing

    adammw authored
  7. @adammw
  8. @adammw
  9. @adammw

    Remove Spotify#similar

    adammw authored
    No longer needed now we have Track#similar
  10. @adammw

    example: add playlistEvents

    adammw authored
    This example script demonstrates how to listen for events on the
    playlist instance.
  11. @adammw
  12. @adammw
  13. @adammw

    user: fix typo in User#rootlist

    adammw authored
  14. @adammw
  15. @adammw
  16. @adammw

    user: implement User#starred

    adammw authored
  17. @adammw
  18. @adammw
  19. @adammw
  20. @adammw
  21. @adammw
  22. @adammw
  23. @adammw

    playlist: add remove methods

    adammw authored
  24. @adammw
Commits on May 4, 2014
  1. @adammw

    spotify: new flash key, moved sp_log and sp_user_info commands after …

    Brandt Abbott authored adammw committed
    …login_complete
    
    Squashed commit of the following:
    
    commit 0498c45
    Author: Brandt Abbott <brandt.abbott@readytalk.com>
    Date:   Sat Apr 26 07:36:26 2014 -0600
    
        Issue #81 forgot to remove calls from _onconnect, it was late at night
    
    commit 9268e2f
    Author: Brandt Abbott <brandt.abbott@readytalk.com>
    Date:   Fri Apr 25 23:25:48 2014 -0600
    
        Issue #81 - New flash key.  Moved sp_log and sp_user_info commands after login_complete
    
    Fixes #81.
    Closes #82.
    
    Conflicts:
    	lib/spotify.js
Something went wrong with that request. Please try again.