CodingGarden / listd

listd is a Full Stack App that will allow users to create, share and watch lists of YouTube channels. This app is being built LIVE on Twitch https://twitch.tv/codinggarden
https://twitch.tv/codinggarden
MIT License
191 stars 53 forks source link

fix(YouTubeAPI): skip videos.list if we do not have any ids #128

Closed mdujava closed 1 year ago

mdujava commented 1 year ago

What type of Pull Request is this?

What is the current behavior?

When Youtube API returns list of 50 videos, that would not have valid IDs (after filtering undefineds) youtube videos.list would be called with empty id list, resulting in a No filter selected. Expected one of: myRating, id, chart, and results with an server error and empty list in response/UI

What is the new behavior?

When ids after filtering are empty, we skip call to youtube API and transformation of data. Flow should continue with another recursion call or return from the function.