Skip to content

Commit 55b25c2

Browse files
authored
Merge pull request #4 from ajhsu/feature/fill-up-sharedplaylist-api
Fill up the `SharedPlaylistFetcher` API
2 parents 5960961 + 18f10eb commit 55b25c2

3 files changed

Lines changed: 17 additions & 2 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kkbox/kkbox-js-sdk",
3-
"version": "1.0.3",
3+
"version": "1.1.0",
44
"description": "KKBOX Open API developer SDK for JavaScript. Use it to easily access KKBOX open API to get various metadata about KKBOX's tracks, albums, artists, playlists and stations. ",
55
"main": "./dist/SDK.js",
66
"scripts": {

src/api/Api.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import NewHitsPlaylistFetcher from './NewHitsPlaylistFetcher'
1010
import GenreStationFetcher from './GenreStationFetcher'
1111
import MoodStationFetcher from './MoodStationFetcher'
1212
import ChartFetcher from './ChartFetcher'
13+
import SharedPlaylistFetcher from './SharedPlaylistFetcher'
1314

1415
/**
1516
* Fetch KKBOX resources.
@@ -91,6 +92,11 @@ export default class Api {
9192
/**
9293
* @type {ChartFetcher}
9394
*/
94-
this.chartFetcher = new ChartFetcher(this.httpClient, this.territory)
95+
this.chartFetcher = new ChartFetcher(this.httpClient, this.territory)
96+
97+
/**
98+
* @type {SharedPlaylistFetcher}
99+
*/
100+
this.sharedPlaylistFetcher = new SharedPlaylistFetcher(this.httpClient, this.territory)
95101
}
96102
}

test/sdktest.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,15 @@ describe('SDK Begin to Test', () => {
101101
return api.newHitsPlaylistFetcher.fetchAllNewHitsPlaylists().then(response => response.status.should.be.exactly(200))
102102
})
103103
})
104+
105+
describe('Shared Playlist', () => {
106+
it('should response status 200', () => {
107+
return api.sharedPlaylistFetcher.setPlaylistID('KsOjSf4whgbL45hRfl').fetchMetadata().then(response => response.status.should.be.exactly(200))
108+
})
109+
it('should response status 200', () => {
110+
return api.sharedPlaylistFetcher.setPlaylistID('KsOjSf4whgbL45hRfl').fetchTracks().then(response => response.status.should.be.exactly(200))
111+
})
112+
})
104113
})
105114
})
106115
})

0 commit comments

Comments
 (0)