File tree Expand file tree Collapse file tree 2 files changed +23
-5
lines changed Expand file tree Collapse file tree 2 files changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -183,16 +183,18 @@ actions = McFly.createActions({
183183 fetchPlaylists : function ( ) {
184184 return SoundCloud . fetchPlaylists ( )
185185 . then ( function ( playlists ) {
186- return {
187- 'actionType' : 'LOADED_PLAYLISTS' ,
188- 'playlists' : playlists
189- }
186+ return SoundCloud . fetchPlaylistLikes ( )
187+ . then ( function ( likes ) {
188+ return {
189+ 'actionType' : 'LOADED_PLAYLISTS' ,
190+ 'playlists' : playlists . concat ( likes )
191+ }
192+ } )
190193 } )
191194 . catch ( function ( ex ) {
192195 console . error ( ex )
193196 } )
194197 } ,
195-
196198} )
197199
198200module . exports = actions
Original file line number Diff line number Diff line change @@ -158,6 +158,22 @@ SoundCloud.prototype.fetchPlaylists = function() {
158158 } )
159159}
160160
161+ SoundCloud . prototype . fetchPlaylistLikes = function ( ) {
162+ return this . makeRequest ( 'e1/me/playlist_likes' )
163+ . then ( )
164+ . bind ( this )
165+ . map ( function ( resp ) {
166+ return resp . playlist
167+ } )
168+ . map ( this . _mapTrack )
169+ . map ( function ( playlist ) {
170+ playlist . tracks = _ . map ( playlist . tracks , function ( track ) {
171+ return this . _mapTrack ( track )
172+ } . bind ( this ) )
173+ return playlist
174+ } )
175+ }
176+
161177SoundCloud . prototype . expandPlaylist = function ( playlist ) {
162178 if ( ! playlist . hasOwnProperty ( 'tracks_uri' ) || playlist . kind !== 'playlist' )
163179 return
You can’t perform that action at this time.
0 commit comments