Skip to content

Bulk prefetch data at run start instead of hammering APIs per item #2580

@rinseaid

Description

@rinseaid

I have a very large Plex library, and Maintainerr often takes hours to run. I have a handful of Maintainerr collections with reasonably complex rules including things like if I have ever watched a show, don't delete it.

I had a look at the source to figure out why and it's making individual API calls to Tautulli and Sonarr for every item in the library. One of my collections has nearly 500 shows, which equates to a lot of sequential HTTP requests.

Both APIs can return everything in one shot. Tautulli has 'get_history?length=100000', Sonarr has 'GET /api/v3/series'. If the 'getter' services loaded all the data upfront and did lookups from there, I'd expect runs to go from 25+ minutes down to under a minute.

Happy to take a crack at a PR if you're open to it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions