Trakt lists: keep the Radarr/Sonarr lookups of their titles on disk

Library membership is asked every time via movie?tmdbId= / series?tvdbId=;
only the lookups of titles not in the library are stored (3 days).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-24 20:48:20 +02:00
co-authored by Claude Opus 5.5
parent a70daaa0a3
commit f0bc284e82
10 changed files with 281 additions and 15 deletions
+6 -3
View File
@@ -37,7 +37,8 @@ type App struct {
theme theme // the colors in use
trakt *trakt.Client // trending, most watched and anticipated lists, casts
people *peopleCache // casts loaded from Trakt
disk *diskCache // posters and casts kept between runs
disk *diskCache // posters, casts and lookups kept between runs
lookups *lookupStore // Radarr/Sonarr lookups of Trakt list titles
// Called (on the UI goroutine) a moment after a release was grabbed.
afterGrab []func()
// The Movies and Series views, to refresh their Trakt lists.
@@ -188,8 +189,9 @@ func New(cfg *config.Config) *App {
if u := os.Getenv("ARR_TUI_TRAKT_URL"); u != "" {
a.trakt.SetBaseURL(u) // another Trakt API, for development (dev/screenshots)
}
movies := newSearchView(a, radarrBackend{radarrClient})
series := newSearchView(a, sonarrBackend{sonarrClient})
a.lookups = newLookupStore(a.disk)
movies := newSearchView(a, radarrBackend{radarrClient, a.lookups})
series := newSearchView(a, sonarrBackend{sonarrClient, a.lookups})
a.searches = []*searchView{movies, series}
a.views = []view{
{key: '1', name: "Movies", body: movies.root, onShow: movies.activate, hints: searchHints},
@@ -463,6 +465,7 @@ func (a *App) Run() error {
if a.people.dirty { // casts fetched in the last seconds
_ = a.disk.savePeople(a.peopleSnapshot())
}
_ = a.lookups.save()
}()
go a.disk.prunePosters()
// The screen draws through the theme (see themedScreen).