This commit is contained in:
ponzischeme89
2026-08-19 06:57:59 +12:00
parent 8c847c59b8
commit 2b43b9ef12
94 changed files with 6359 additions and 778 deletions
+24 -1
View File
@@ -44,7 +44,15 @@ type Movie struct {
InCinemas *time.Time `json:"inCinemas"`
// Radarr's own lifecycle word for the title: tba, announced, inCinemas, released,
// deleted. It is what the schedule card's lifecycle tag says.
Status string `json:"status"`
Status string `json:"status"`
// Metadata Radarr carries for a film the household does not hold yet, and which
// therefore has no Emby record to read it from. It is the whole substance of the
// Radarr-only detail page; the schedule card itself uses none of it.
OriginalTitle string `json:"originalTitle,omitempty"`
Studio string `json:"studio,omitempty"`
Certification string `json:"certification,omitempty"`
YouTubeTrailerID string `json:"youTubeTrailerId,omitempty"`
IMDBID string `json:"imdbId,omitempty"`
HasFile bool `json:"hasFile"`
Monitored bool `json:"monitored"`
MovieFile *MovieFile `json:"movieFile"`
@@ -139,6 +147,21 @@ func (c *Client) Calendar(ctx context.Context, start, end time.Time) ([]Movie, e
return movies, nil
}
// Movie is one tracked film, for the case the cached catalogue cannot answer: a title
// added to Radarr since the catalogue was last read. The catalogue is still tried first —
// this is the fallback, not the ordinary path, because a detail page opening must not cost
// a round trip Radarr has already answered once for the whole household.
func (c *Client) Movie(ctx context.Context, movieID int) (Movie, error) {
if movieID <= 0 {
return Movie{}, fmt.Errorf("radarr: invalid movie id")
}
var movie Movie
if err := c.get(ctx, "/api/v3/movie/"+strconv.Itoa(movieID), &movie); err != nil {
return Movie{}, err
}
return movie, nil
}
func (c *Client) Lookup(ctx context.Context, term string) ([]Movie, error) {
req, err := c.request(ctx, "/api/v3/movie/lookup", url.Values{"term": {term}})
if err != nil {