Skip to main content

gather_season_episodes

Function gather_season_episodes 

Source
pub async fn gather_season_episodes<F, Fut>(
    seasons: &[MediaItem],
    fetch_season: F,
) -> Vec<MediaItem>
where F: Fn(String) -> Fut, Fut: Future<Output = Result<SearchResult, RepoError>>,
Expand description

Every episode in seasons, fetched with fetch_season (a season id → its children), all at once.

They used to be fetched one after another, so the wait was the sum of every season’s listing: ~4 s for Frasier’s eleven, on a phone whose cache reads were slowed by a catalog sync writing in the background. Concurrently it is the slowest single season. Order is restored afterwards by sort_series_order, so completion order does not matter.

One failing season must not blank the whole show: its episodes are left out and the rest returned.

TRACES: UR-062 | DR-295 | UT-264