madhuripalle / SpotiFlow

Groove to the Flow
0 stars 1 forks source link

Apply flow to playlist button/JS #19

Open PhoenixJZT opened 8 years ago

PhoenixJZT commented 8 years ago

At the bottom of the Playlist Options/Flow 'page,' there should be a button whose onClick function invokes the appropriate algorithm.

Note: the flow of data is as follows (variable names subject to change): User clicks flow thumbnail -> set var flowName = [selected flow]

// Functionality of Playlist Options (all optional) User turns Duration "on" -> enable duration dropdowns User turns Duration "off" -> disable duration dropdowns User sets Duration -> set var setDuration = function() {calculate duration in seconds and return}

User clicks this button -> start function that invokes the algorithm corresponding to flowName and pass the variables listed above to it as well as the current playlist from the get-playlist-tracks endpoint.

PhoenixJZT commented 8 years ago

We will both work on this

PhoenixJZT commented 8 years ago

The function that cuts down the playlist based on the durationAttributes. i.e. that functionality should probably be invoked inside of the flow algorithms, since we request the Echo Nest endpoints for each of the playlist tracks inside them and we don't want to do that more than once.

PhoenixJZT commented 8 years ago

I'm going to add a google drive doc on which we can collaborate over tonight and tomorrow to do some pseudocode for the flow algorithms

That way we can have a standardized way to create them, and we can help eachother write them if necessary.

clsd3294 commented 8 years ago

I think I forgot to discuss with you about one of my question today. I have a question about the flowAttributes and durationAttributes. Things seem that if you choose a flow, you choose 3 flow attributes, and you can also choose 3 attributes if the duration is longer than the current playlist's. If the 3 duration attributes is not totally the same as the other 3 in flow attributes, while that be a problem? Current playlist is just the track collection, right? So, does the user is required to choose 3 same things twice. Otherwise, if the 3 attributes are not the same, do we fit a flow using 3 variables and keep the duration using another 3 variables, does it make sense?

PhoenixJZT commented 8 years ago

It shouldn't be a problem. The duration attributes are about removing the tracks with the lowest values from the playlist -> this happens first, before the flow is really applied. Then the flows "shape" or reorder the tracks still in the playlist according to their relative values.

The two sets of attributes don't have to be the same

PhoenixJZT commented 8 years ago

Take a look at the sample function I put in the google doc for Bactrian