💿 Create Playlist: Generate a Playlist in Spotify - Spotify-Open-Recommendation-Engine/spotify-open-recommendation-engine GitHub Wiki

Endpoint: /create_playlist_req

Located in controllers.py.

Interacting with /create_playlist_req

Given a list of songs, create a playlist of these tracks in the user's spotify library.

  • Input:
    • songs - a list of track ids
  • Output:
    • A playlist id for the playlist genreated
    • Playlist object with list of given tracks generated in the user's librabry in the Spotify app

Function: create_playlist()

Located in controllers.py.

Interacting with create_playlist()

  • This is the function called when the endpoint (/create_playlist_req) is hit. If you hit the endpoint, you're running this function.
  • This function checks for valid parameter

Function: create_playlist

Located in /scripts/create_playlist .

Interacting with create_playlist()

  • This function is called by create_playlist_req(), inside controllers.py - when the endpoint (/create_playlist_req) is hit. If you're running create_playlist_req(), you're using create_playlist().
  • This is where Spotify/Spotify API call is made to fetch the user's Spotify account id, create a playlist object, and then add the given list of track ids to the new playlist object.
  • The id of the new playlist 'playlist_id' is returned