Auto-failover to alternate source when AllManga lacks the episode#129
Merged
Conversation
AllManga doesn't always have every episode (especially newer or less
popular titles). The default source for anime content is AllManga, so
the user currently gets an "Episode not found on AllManga · Try a
different source" overlay and has to manually switch sources each visit.
Add per-episode failover:
* On AllManga resolve failure (res.ok === false), automatically switch
to the next non-async source (Videasy → VidSrc → 2Embed) and remember
the choice in localStorage keyed by (tmdbId, season, episode, dub).
* On subsequent visits to the same episode, skip the AllManga IPC call
and load the cached fallback directly.
* On AllManga resolve success, clear the cache entry so we don't keep
overriding once the title becomes available upstream.
* Manual source picks clear the entry for the current episode, so the
auto-switch can't fight the user's explicit choice.
Network/timeout errors still surface the existing error overlay — only
explicit "episode missing" responses trigger the failover, so a flaky
connection won't silently change sources.
Covers both episodic content (TVPage) and movies (MoviePage). Cache
keys: tv_<tmdbId>_s<season>_e<ep>_<sub|dub> and movie_<tmdbId>_<sub|dub>.
- storage: cap failover cache at 200 entries with ts-based eviction - api: rewrite getNextNonAsyncSource using filter instead of modulo - movie/tv: add resolvingUrlRef + resolvedPlayerUrlRef to fix stale-closure bug in resolve effects - movie/tv: replace hardcoded "allmangaDubMode"/"playerSource" strings with STORAGE_KEYS - movie/tv: replace playerSource==="allmanga" guards with sourceIsAsync()/isAsync
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.