UCLA-Creative-Labs / spot-the-song

MIT License
2 stars 0 forks source link

🚀 Feature: add search preview when guessing a song name #7

Open darren2hang opened 1 year ago

darren2hang commented 1 year ago

When the user is trying to guess the song playing, we want to have a dropdown search bar to help the user guess the song. We would display songs that contain the strings in the user search string.

Use Case

Proposed Solution

Use the GET /song endpoint to get a list of songs. Then, use the user's search string to search among the list of all songs

The GET /song endpoint will return an array of song objects. Each song object will have a name, id, and artists property. The name is just a string. The artists property is an array of artist names. For example, a song object may look like { name: 'Song Name', artists: ['Singer 1', 'Singer 2'], id: '83qEyue93wdui1JIURJwfw39', }

When we search for a song, the string we want to display in the preview is "Name - Artist 1, Artist 2, ...", so for the previous song object example, the string preview of the song would be "Song Name - Singer 1, Singer 2"

For our search algorithm, we would just see if the song preview string contains any of the words from the search string


This is a :rocket: Feature Request