Documentation
¶
Overview ¶
Package overseerr talks to Overseerr, the app people run next to their media server to discover titles and ask for them. Jellyseerr serves the same API, so it works too.
Matinee uses it for the Discover tab: trending and popular titles, recommendations based on what someone watched, and asking for a title, which Overseerr then approves and hands to Radarr or Sonarr by its own rules.
Everything Matinee needs from Overseerr goes through Client, so the rest of the server doesn't know its API.
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) Discover(ctx context.Context, list string) ([]Title, error)
- func (c *Client) DiscoverPage(ctx context.Context, list string, page int) ([]Title, int, error)
- func (c *Client) Lookup(ctx context.Context, kind string, tmdbID int) (Title, []int, error)
- func (c *Client) Recommendations(ctx context.Context, kind string, tmdbID int) ([]Title, error)
- func (c *Client) RecommendationsPage(ctx context.Context, kind string, tmdbID, page int) ([]Title, int, error)
- func (c *Client) Request(ctx context.Context, kind string, tmdbID int, seasons []int, userID int) (int, error)
- func (c *Client) Search(ctx context.Context, q string) ([]Title, error)
- func (c *Client) Status(ctx context.Context) (Status, User, error)
- func (c *Client) URL() string
- func (c *Client) Users(ctx context.Context) ([]User, error)
- type Config
- type Error
- type Status
- type Title
- type User
Constants ¶
const ( StatusUnknown = 1 StatusPending = 2 // asked for, waiting for approval StatusProcessing = 3 // approved, on its way StatusPartial = 4 // some seasons are available StatusAvailable = 5 )
Media statuses, as Overseerr tracks them.
const ( RequestPending = 1 RequestApproved = 2 RequestDeclined = 3 )
Request states, as Overseerr returns them.
Variables ¶
var ErrNotFound = errors.New("not found")
ErrNotFound means Overseerr doesn't know the title.
var Lists = map[string]struct{ Path, Kind string }{
"trending": {"/discover/trending", ""},
"popular-movies": {"/discover/movies", "movie"},
"popular-shows": {"/discover/tv", "tv"},
"upcoming-movies": {"/discover/movies/upcoming", "movie"},
"upcoming-shows": {"/discover/tv/upcoming", "tv"},
}
Lists Overseerr's discover pages offer, by the name Matinee uses.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client calls Overseerr's API (v1).
func (*Client) DiscoverPage ¶
DiscoverPage is a page (from 1) of one of Lists, and how many pages it has.
func (*Client) Recommendations ¶
Recommendations lists titles like a movie or show (kind), by its TMDB id.
func (*Client) RecommendationsPage ¶
func (c *Client) RecommendationsPage(ctx context.Context, kind string, tmdbID, page int) ([]Title, int, error)
RecommendationsPage is a page (from 1) of Recommendations, and how many pages there are.
func (*Client) Request ¶
func (c *Client) Request(ctx context.Context, kind string, tmdbID int, seasons []int, userID int) (int, error)
Request asks for a movie, or every season of a show, as an Overseerr user (0 for the key's owner). Overseerr approves it or not by that user's permissions, and returns where the request stands.
type Config ¶
type Config struct {
URL string `json:"url"`
APIKey string `json:"apiKey"`
// RequestAs is the Overseerr user that requests are made as for people
// without an Overseerr account of the same name; 0 means the API key's
// owner.
RequestAs int `json:"requestAs"`
}
Config is how Matinee reaches Overseerr, set by an admin. The API key stays on the server.
type Status ¶
type Status struct {
Version string `json:"version"`
}
Status is what Overseerr says about itself.
type Title ¶
type Title struct {
Kind string `json:"kind"` // movie or show
TMDBID int `json:"tmdbId"`
Title string `json:"title"`
Year int `json:"year,omitempty"`
Overview string `json:"overview,omitempty"`
Poster string `json:"poster,omitempty"`
Backdrop string `json:"backdrop,omitempty"`
Rating float64 `json:"rating,omitempty"` // TMDB's, out of 10
// MediaStatus is where Overseerr has it (see the Status constants); 0
// when nobody has asked for it.
MediaStatus int `json:"-"`
}
Title is a movie or a show as Overseerr lists it.
type User ¶
type User struct {
ID int `json:"id"`
Email string `json:"email,omitempty"`
Username string `json:"username,omitempty"`
PlexUsername string `json:"plexUsername,omitempty"`
JellyfinUsername string `json:"jellyfinUsername,omitempty"`
DisplayName string `json:"displayName,omitempty"`
}
User is an Overseerr account.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package overseerrtest is a pretend Overseerr for tests: just enough of its v1 API for what Matinee calls.
|
Package overseerrtest is a pretend Overseerr for tests: just enough of its v1 API for what Matinee calls. |