Keep posters and casts between runs

Posters (the downloaded bytes, per size, 30 days, at most 200 MB) and
casts (people.json, 7 days, at most 2000) are stored in the user's cache
directory (os.UserCacheDir()/arr-tui) and used on the next start before
asking the servers. Expired posters are pruned at startup, casts are
written shortly after new ones arrive and on exit. Tests turn the cache
off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-24 10:35:02 +02:00
co-authored by Claude Opus 5.5
parent 4eace6849e
commit 1056846a48
10 changed files with 381 additions and 13 deletions
+1
View File
@@ -9,5 +9,6 @@ import (
// support and its colors (the probe writes to and reads from /dev/tty).
func TestMain(m *testing.M) {
terminalAnswers = func() terminalInfo { return terminalInfo{} }
cacheDirFunc = func() string { return "" } // never the user's cache
os.Exit(m.Run())
}