Skip to content

Cache background URLs for instant background on game switch#896

Open
shatyuka wants to merge 7 commits into
mainfrom
fix/bg-cache
Open

Cache background URLs for instant background on game switch#896
shatyuka wants to merge 7 commits into
mainfrom
fix/bg-cache

Conversation

@shatyuka

Copy link
Copy Markdown
Contributor

Main Goal

Cache background image URLs to config and preload background before region loading, so the cached or preset background appears instantly on game switch without waiting for API download.
If the background files are cached locally, the background is displayed immediately. If not cached, the game-specific preset placeholder is shown while the real background downloads in the background.

Games added via plugins have not yet been tested.

PR Status :

  • Overall Status : Done
  • Commits : Done
  • Synced to base (Collapse:main) : Yes
  • Build status : OK
  • Crashing : No
  • Bug found caused by PR : -

@shatyuka
shatyuka marked this pull request as ready for review July 22, 2026 16:01
Comment on lines +134 to +138
bool willDisplayStatic = !IsVideoMediaFileExtensionSupported(primaryBg ?? staticBgUrl!) ||
(!CurrentIsEnableCustomImage &&
!GlobalIsEnableCustomImage &&
!CurrentIsEnableBackgroundAutoPlay);
Uri accentPreviewUri = willDisplayStatic ? new Uri(localStatic) : new Uri(localBackground);

This comment was marked as outdated.

Comment on lines +379 to +383
Color syncColor = Task.Run(async () =>
await ColorPaletteUtility.GetMediaAccentColorFromAsync(fallbackSourceUri, false)
).GetAwaiter().GetResult();
ThemeRootElement.ChangeAccentColor(syncColor);
LauncherConfig.SetAndSaveConfigValue($"{cachedBgKey}-AccentColor",

This comment was marked as outdated.

ImageSource = new BitmapImage(new Uri(placeholderPath)),
Stretch = Stretch.UniformToFill
};
PresenterGrid.Children.Clear();

This comment was marked as outdated.

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.

1 participant