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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user