You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: I corrected the typo in amplitude.js per issue #230 first.
My init has 25 songs in it with two playlists. The first playlist is composed of 12 songs, with song indexes 0 to 11. The second playlist is composed of 13 songs, with song indexes from 12 to 24.
Calling Amplitude.getSongsInPlaylist("first_playlist") returns array with 12 entries corresponding to the songs at indexes 0 to 11. No problem here.
Calling Amplitude.getSongsInPlaylist("second_playlist") returns array with 13 entries. While the count of the songs is correct, the array returns the songs at indexes 0 to 12 rather than 12 to 24.
/*--------------------------------------------------------------------------
Gets all of the songs in a playlist
Public Accessor: Amplitude.getSongsInPlaylist( playlist );
@param string playlist The playlist key
--------------------------------------------------------------------------*/
function getSongsInPlaylist(playlist) {
var songsArray = [];
for (var i = 0; i < _config2.default.playlist[playlist].length; i++) {
songsArray.push(_config2.default.songs[i]);
}
return songsArray;
}
The fixed function:
function getSongsInPlaylist(playlist) {
var songsArray = [];
for (var i = 0; i < _config2.default.playlists[playlist].length; i++) {
var songIndex = _config2.default.playlists[playlist][i];
songsArray.push(_config2.default.songs[songIndex]);
}
return songsArray;
}
Environment
Issue description
Note: I corrected the typo in amplitude.js per issue #230 first.
My init has 25 songs in it with two playlists. The first playlist is composed of 12 songs, with song indexes 0 to 11. The second playlist is composed of 13 songs, with song indexes from 12 to 24.
Calling Amplitude.getSongsInPlaylist("first_playlist") returns array with 12 entries corresponding to the songs at indexes 0 to 11. No problem here.
Calling Amplitude.getSongsInPlaylist("second_playlist") returns array with 13 entries. While the count of the songs is correct, the array returns the songs at indexes 0 to 12 rather than 12 to 24.
Steps to reproduce the issue
What is expected?
I'd expect an array returned listing songs from the second playlist.
Link to where issue can be reproduced
http://test.gracemenagerie.com/music2.html
Additional details / screenshots
Note: I corrected the typo in amplitude.js per issue #230.
The text was updated successfully, but these errors were encountered: