Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Epic - Spotify Service #38

Open
14 tasks
Jonpatt92 opened this issue Feb 19, 2020 · 0 comments
Open
14 tasks

Epic - Spotify Service #38

Jonpatt92 opened this issue Feb 19, 2020 · 0 comments
Labels
Backend Epic Spotify Service Functionality that interacts with the Spotify API

Comments

@Jonpatt92
Copy link
Collaborator

Jonpatt92 commented Feb 19, 2020

As a developer,
When I request a Song's information using GET api/v1/songs?title=<title>

  • The Service will first query the Database for a record in the Songs table with the requested title.

  • The Service will return the matching Song record in JSON format, example below.

If no record is found
Spotify API Song Search Endpoint - User Story #32

  • The Service will have a valid Access Token ready to use (Token Generator - User Story User Story - Spotify API Token Generator #29)

  • The Service will use the Spotify API Search endpoint to look for the requested Song using the original request's params.title. Returning an array of songs in tracks.items

  • The Service will first query the Database for records matching spotify_id = tracks.items[0..5].id.

  • If a record is returned from one of the spotify_ids. The Service will return that object in JSON. Which will end the Service's workflow.

  • If no record is returned. The Service will find the requested song by comparing tracks.items[0..5].name to params.title. Then use the first element it matches with.

  • The Service will store the name, id, and url of the matched element to be used in the next step.

  • Spotify API Song Search - User Story User Story - Spotify API Song Search #32 Complete
    .

Spotify API Audio Analysis Endpoint - User Story #37

  • The Service will request Audio Analysis data at GET https://api.spotify.com/v1/audio-analysis/<spotify_id> using the spotify_id from the Song Search response.

  • The Service will create a record in the Songs table using the title, spotify_id, url from the Song Search response. Along with the delay, avg_bar_duration, duration, tempo, and time_signature from the Audio Analysis response.

  • The Service returns the formatted JSON object indicated below.

{
  spotify_id: '3KzgdYUlqV6TOG7JCmx2Wg',
  title: 'Beyond The Sea',
  url: 'https://open.spotify.com/track/3KzgdYUlqV6TOG7JCmx2Wg',
  duration: 172.48,
  delay: 0.543,
  avg_bar_duration: 1.764,

  tempo: 136.483,

  time_signature: 4
}
@Jonpatt92 Jonpatt92 added Backend Spotify Service Functionality that interacts with the Spotify API Epic labels Feb 19, 2020
@Jonpatt92 Jonpatt92 added this to To do in Ballroom Beats Feb 19, 2020
@spaceplesiosaur spaceplesiosaur moved this from To do to Next Sprint in Ballroom Beats Feb 20, 2020
@spaceplesiosaur spaceplesiosaur moved this from Next Sprint to Icebox in Ballroom Beats Feb 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend Epic Spotify Service Functionality that interacts with the Spotify API
Projects
Ballroom Beats
  
Icebox
Development

No branches or pull requests

1 participant