fix: Auto download Lotw user list at launch

This commit is contained in:
2026-07-09 21:13:34 +02:00
parent 16e780c2df
commit efb61107fe
2 changed files with 27 additions and 4 deletions
+11
View File
@@ -50,6 +50,17 @@ func (m *Manager) Info() (date string, count int) {
return m.db.Date(), m.db.Count()
}
// NeedsRefresh reports whether the cached country file is missing or older than
// maxAge — so the caller re-downloads it to pick up newly-added date-ranged
// exceptions (e.g. an event call's fresh SARDINIA period).
func (m *Manager) NeedsRefresh(maxAge time.Duration) bool {
fi, err := os.Stat(m.Path())
if err != nil {
return true // missing
}
return time.Since(fi.ModTime()) > maxAge
}
// EnsureLoaded loads the cached file into memory if present. Does NOT download.
func (m *Manager) EnsureLoaded() error {
if m.Loaded() {