Documentation
¶
Overview ¶
Package skyhook reads SkyHook, Sonarr's metadata service, for a series' episode list in one of its orders, the lists Sonarr builds its own from. A request reaches only https://skyhook.sonarr.tv, on a public address.
Index ¶
Constants ¶
const MaxBody = 16 << 20
MaxBody bounds one answer; a larger one is refused, never cut.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client reads SkyHook; it is safe for concurrent use.
func New ¶
New copies base, nil meaning a zero client, onto ssrf's transport, which dials only public addresses on port 443, with an exact-origin redirect policy; a nil log is slog.Default.
func (*Client) Show ¶
Show reads GET /v2/tvdb/shows/{lang}/{tvdbID}/{order}, the request Sonarr 5 makes, in at most 3 attempts inside ctx's deadline. tvdbID is 1 to 2^31-1, lang three ASCII lowercase letters and order 1 to 32 bytes of [a-z0-9]; any other is an error with nothing sent. A 404 answers (Show{}, false, nil). A 408, 429, 5xx or transport failure, after the last attempt, is an httpclient.IsTransient error, and no other failure is. An error's text is one line naming the series and order, never the answer's body.
type Episode ¶
type Episode struct {
AirDate, Title string // "" when SkyHook sends null
ID uint64 // the TVDB episode id
Season, Number, Absolute int // Absolute 0 when SkyHook sends none
}
Episode is one episode where the requested order places it. ID passes media.ValidExternalID and each number media.ValidEpisodeNumber.