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
+13
View File
@@ -102,6 +102,19 @@ func (c *Client) Movies(ctx context.Context) ([]Movie, error) {
return movies, err
}
// MovieByTMDB returns the library movie with the TMDb id, ok=false if the
// library has none. Unlike a lookup it does not ask the metadata provider.
func (c *Client) MovieByTMDB(ctx context.Context, tmdbID int) (Movie, bool, error) {
var movies []Movie
err := c.Do(ctx, http.MethodGet, "movie", url.Values{"tmdbId": {strconv.Itoa(tmdbID)}}, nil, &movies)
for _, m := range movies { // checked: a version that ignores the filter sends the whole library
if m.TMDBID == tmdbID && m.InLibrary() {
return m, true, err
}
}
return Movie{}, false, err
}
// AddOptions are the choices from the add form.
type AddOptions struct {
QualityProfileID int