Persist author cache to disk for instant channel info across restarts

Back the in-memory authorCache with a JSON file in ~/Library/Caches/AuthorCache/.
Disk is lazy-loaded on first lookup and saved asynchronously on each cache update.
Capped at 500 entries to prevent unbounded growth.

- Cache author data from video detail API responses (PlayerService, VideoInfoView)
- Replace ChannelView's private CachedChannelHeader with shared CachedChannelData
- Enrich author with cached avatar/subscriber count in VideoChannelRow, TVDetailsPanel, VideoInfoView
This commit is contained in:
Arkadiusz Fal
2026-02-12 05:47:43 +01:00
parent d1d7edb5ec
commit fd41833532
6 changed files with 185 additions and 37 deletions

View File

@@ -303,6 +303,7 @@ final class PlayerService {
// Update state with full video details and selected stream
state.setCurrentVideo(fullVideo, stream: selectedStream, audioStream: selectedAudioStream)
CachedChannelData.cacheAuthor(fullVideo.author)
state.videoDetailsState = .loaded
lockDurationIfNeeded(for: fullVideo, stream: selectedStream)