Home

dev / openkara

publicthedavidweng/OpenKara· sync paused
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

fix(remote): skip eviction on verified hits, restore fast-path skip, wire persist_ranges

2 months ago

87b2055
Authored
Davy7/20/2026, 8:29:47 PM
- get_or_create now only calls evict_if_needed when creating a new entry.
  A verified hit is already counted in the catalog, so evicting for it
  double-counted the size and could delete the very entry being reused
  when the cache was near its budget.
- ensure_remote_file_cached now has a fallback fast-path that checks
  destination existence + size match when no catalog row exists. The
  catalog lookup only succeeds when a remote_cache_entries row exists,
  but atomic_download never creates one. Without this fallback, non-
  streaming remote media, CDG graphics, and imported remote files were
  re-downloaded on every access.
- spawn_fetch_thread_with_fetcher now accepts an optional on_range_written
  callback that is invoked after each successful range write. The
  streaming playback path passes a callback that calls
  CacheCatalog::persist_ranges, so downloaded_ranges_json and complete
  are updated in real time. Without this, the catalog never recorded
  download progress, so cached remote audio was re-downloaded after
  restart and completed-entry verification never ran.

Parent3c58375

4 files changed
  • src-tauri/src/audio/remote_source.rs+20−0
  • src-tauri/src/remote/cache_catalog.rs+6−2
  • src-tauri/src/remote/sync/revision.rs+15−0
  • src-tauri/src/services/playback_source.rs+13−0