Skip to content

perf(shows) / consolidate season video requests#1966

Merged
trakt-bot[bot] merged 1 commit intomainfrom
feat/improve_video_load
Mar 26, 2026
Merged

perf(shows) / consolidate season video requests#1966
trakt-bot[bot] merged 1 commit intomainfrom
feat/improve_video_load

Conversation

@vladjerca
Copy link
Copy Markdown
Contributor

Overview

Improves the efficiency of loading show-related videos by replacing multiple per-season network requests with a single consolidated API call. This optimization reduces network latency and simplifies the data requirements for show detail pages.

Changes

  • Refactors the show video query to fetch all season videos in one request using the 'all' parameter instead of mapping over individual seasons.
  • Updates the utility function to support the 'all' string literal for season-based API calls.
  • Simplifies the useShowVideos hook and the show page implementation by removing the need to track and pass an array of season numbers.
  • Streamlines query dependency tracking to focus solely on the show slug.

Testing

  • Verified that show and season-level videos continue to load and display correctly on the show details page.
  • Monitored the network tab to confirm that multiple season video requests are now replaced by a single API call.

@vladjerca vladjerca requested a review from seferturan March 26, 2026 15:10
@trakt-bot trakt-bot bot enabled auto-merge (rebase) March 26, 2026 15:10
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request optimizes the loading of show-related videos by consolidating multiple individual season requests into a single, more efficient API call. By simplifying the data requirements and streamlining dependency tracking, the changes reduce network latency and simplify the implementation across the show details page.

Highlights

  • Consolidated API Requests: Replaced multiple per-season network requests with a single consolidated API call using the 'all' parameter.
  • Simplified Hook and Component Logic: Removed the requirement to track and pass an array of season numbers in the useShowVideos hook and show page implementation.
  • Optimized Query Dependencies: Streamlined query dependency tracking to rely solely on the show slug, improving efficiency.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the show video fetching logic to retrieve all season videos in a single request using the 'all' parameter, rather than making individual requests for each season. This involves updating the showVideosQuery, the castNumberAsString utility, and the useShowVideos hook and its usage in the show page. Feedback was provided to improve the robustness of the data fetching by explicitly returning an empty array if the season videos request returns a non-200 status code, which prevents potential mapping errors if a 404 response body is not an array.

@deepsource-io
Copy link
Copy Markdown

deepsource-io bot commented Mar 26, 2026

DeepSource Code Review

We reviewed changes in 0b10ba7...96c00fc on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Coverage  

Code Review Summary

Analyzer Status Updated (UTC) Details
JavaScript Mar 26, 2026 5:24p.m. Review ↗
Test coverage Mar 26, 2026 5:24p.m. Review ↗

Code Coverage Summary

Language Line Coverage (Overall)
Aggregate
80.6%
Javascript
80.6%

➟ Additional coverage metrics may have been reported. See full coverage report ↗

consolidate multiple per-season video requests into a single api call using the 'all' season parameter. this reduces network overhead and simplifies the query logic by removing the requirement to pass and track individual season numbers.
@seferturan seferturan force-pushed the feat/improve_video_load branch from 5c51cc7 to 96c00fc Compare March 26, 2026 17:24
@trakt-bot trakt-bot bot merged commit dad6a63 into main Mar 26, 2026
11 checks passed
@trakt-bot trakt-bot bot deleted the feat/improve_video_load branch March 26, 2026 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants