Streamability icon indicating copy to clipboard operation
Streamability copied to clipboard

✏️ Refactor Providers Component

Open maxh1231 opened this issue 10 months ago • 1 comments

Is your feature request related to a problem or need? Please describe.

Currently, the Providers component accepts a showType and id prop and calls the getTvProviders or getMovieProviders requests. Instead of passing the component the applicable data to render an individual provider.

While this isn't inherently bad, with the ability to append watch/providers to the getTvDetails and getMovieDetails (which we're already doing), it may be better to pull the necessary data from those requests and pass it to the component. This would also eliminate a request.

Additional context

The original thought with this component may have been to render providers based on the signed-in user's set country of origin, which would require the standalone getWatchProviders request. However, I'm not sure that we're prepared to implement that functionality. I believe the watch/providers query parameter defaults to US.

Component implements providers.results.US.flatrate.map() - hardcoded US providers

Providers data included in getTvProviders and getMovieProviders: Image

Perhaps @Thenlie can opine on this, and this issue in general.

maxh1231 avatar Feb 18 '25 03:02 maxh1231

The original thought with this component may have been to render providers based on the signed-in user's set country of origin, which would require the standalone getWatchProviders request.

This was the original intention and something I would still like to pursue. With that said, it makes sense to pass the data in when possible.

Maybe for the time being the data can be optionally passed in. If the component gets data, it skips the request and uses the provided data. If not, the request is made and the new data is used (as existing).

Thenlie avatar Feb 18 '25 04:02 Thenlie