JonWash86 / Bonsai-Radio

A playlist management application which leverages the spotify and last.fm apis to bring joy to music nerds
http://www.bonsairadio.com
1 stars 1 forks source link

04 statistics #11

Closed JonWash86 closed 5 years ago

JonWash86 commented 5 years ago

I am so glad you picked up on this already; I only ran into this wrinkle today. The weird part is that every scrobble of the “now playing” song is marked as “now playing,” and lack the “date” attribute.

On Thu, Jan 31, 2019 at 8:30 PM JR Heard notifications@github.com wrote:

@jrheard commented on this pull request.

In public/scripts/scripts.js https://github.com/JonWash86/Station-Manager/pull/11#discussion_r252930617 :

}

+function developPlayListStats(){

  • for(i = 0; i < allCallSongs.length; i++){
  • for(p = 0; p < playListTracks.length; p ++){
  • if (playListTracks[p].track.name.toLowerCase() == allCallSongs[i].name.toLowerCase()){
  • playListTracks[p].playTracker = (playListTracks[p].playTracker + 1);
  • console.log(playListTracks[p].playTracker);
  • // TODO: due to some lameness, if a song has the "now playing" attribute, it'll not have a date attribute. I need to make a long-term fix for this down the line.

fyi - if this is talking about the last.fm api and how sometimes its results will include a single song that's marked as "now playing" and which behaves oddly, my advice is to just drop that song on the ground and pretend it doesn't exist. my senior project in college involved the lastfm api and i ran into issues with the now-playing song and found that the official guidance (or at least the community's recommended best practice, can't remember which) was to ignore now-playing songs and deal only with historical scrobbles. it simplifies things and the now-playing song really doesn't matter - if the user finishes listening to it, it'll appear in their historical scrobbles later!

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/JonWash86/Station-Manager/pull/11#pullrequestreview-198923203, or mute the thread https://github.com/notifications/unsubscribe-auth/AcRTz3G55NxEbhHkVfdtNyK71Qf-LMAgks5vI8LfgaJpZM4adnme .

jrheard commented 5 years ago

The weird part is that every scrobble of the “now playing” song is marked as “now playing,” and lack the “date” attribute.

hm, let's talk about this in-person sometime (we can compare calendars at the thing tomorrow) - i think we could sort this out if you have time to walk me through an example or two on your computer! i also think i may be misunderstanding this part of the code (i'm actually not positive whether this is last.fm api stuff or spotify stuff), so i may need you to walk me through the problem from scratch - but i'm confident that once we get going, we can quickly sort out what's happening here!