0.2.77
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user