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
@@ -111,6 +111,19 @@ func (c *Client) Series(ctx context.Context) ([]Series, error) {
return series, err
}
// SeriesByTVDB returns the library series with the TVDB id, ok=false if the
// library has none. Unlike a lookup it does not ask the metadata provider.
func (c *Client) SeriesByTVDB(ctx context.Context, tvdbID int) (Series, bool, error) {
var series []Series
err := c.Do(ctx, http.MethodGet, "series", url.Values{"tvdbId": {strconv.Itoa(tvdbID)}}, nil, &series)
for _, s := range series { // checked: a version that ignores the filter sends the whole library
if s.TVDBID == tvdbID && s.InLibrary() {
return s, true, err
}
}
return Series{}, false, err
}
// AddOptions are the choices from the add form.
type AddOptions struct {
QualityProfileID int