Skip to content

Inefficient loading of results for Manual Search #12119

@Misofist

Description

@Misofist

Describe the bug
When I go into a show and use the "manual search" option for an episode or season, the search results are loaded into the client via many requests.

Part of the reason for this is because the requested URL is /api/v2/providers/{provider}/results?limit=1000&showslug=&season=1&episode=1&page=1. At a minimum the client needs to make one request per provider.

But significantly worse, if the page has been freshly loaded then for most results requests the showslug filter isn't populated, which means that with my 683 show library some providers take as many as 9 requests to load all the pages of data.

To Reproduce

  1. Add multiple shows to Medusa.
  2. Wait for Medusa to complete a backlog search.
  3. Open DevTools network tab. Filter to "results".
  4. On any show, click the "manual search" button next to any episode.
  5. Refresh the page.
  6. Observe how many requests are made and whether they have the showslug specified.

Expected behavior
Medusa should make a single request to load in results from all providers. The Medusa client should specify the showslug property to correctly filter results to the current show.

Screenshots
Image

Medusa (please complete the following information):

Debug logs (at least 50 lines):
No relevant log entries.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions