Build and publish / Test and build (darwin) (push) Successful in 2m3s
Build and publish / Test and build (linux) (push) Successful in 2m45s
Build and publish / Test and build (windows) (push) Successful in 3m13s
Build and publish / Build and publish Docker image (push) Successful in 2m30s
Ombi's v2 Search/tv/{tvdbId} route is a TMDB-keyed alias despite its parameter name, so read_media details and write_request_create season expansion resolved the wrong series for TVDB ids (Gitea issue #1). Repoint tvdb to the legacy v1 Search/tv/info route, label theMovieDbId by origin route (tvdb on TVMaze-backed v1 results, tmdb on the v2 engine) and emit the new tvmaze identifier namespace from seriesId.
307 lines
10 KiB
Go
307 lines
10 KiB
Go
package tools
|
|
|
|
// Output family structs — the domain projections defined by
|
|
// docs/schema/04-results.md ($defs library). Every field set is a
|
|
// closed allowlist: optional members use omitempty so missing
|
|
// upstream values stay absent (never fabricated as false/zero).
|
|
// Nullable contract members use pointers without omitempty so they
|
|
// serialize as explicit JSON null.
|
|
|
|
type OutTarget struct {
|
|
Kind string `json:"kind"` // movie|tv_parent|tv_child|album
|
|
ID int `json:"id"`
|
|
}
|
|
|
|
type Identifier struct {
|
|
Namespace string `json:"namespace"` // tmdb|tvdb|imdb|musicbrainz|tvmaze|ombi_*|provider_unknown
|
|
Value string `json:"value"`
|
|
}
|
|
|
|
type Reference struct {
|
|
ID string `json:"id,omitempty"`
|
|
Name string `json:"name"`
|
|
Value any `json:"value,omitempty"`
|
|
Category string `json:"category,omitempty"`
|
|
}
|
|
|
|
type Credit struct {
|
|
Name string `json:"name"`
|
|
PersonID *int `json:"person_id,omitempty"`
|
|
Role string `json:"role,omitempty"`
|
|
Department string `json:"department,omitempty"`
|
|
}
|
|
|
|
type Provider struct {
|
|
Name string `json:"name"`
|
|
Country string `json:"country,omitempty"`
|
|
Access string `json:"access,omitempty"`
|
|
URL string `json:"url,omitempty"`
|
|
}
|
|
|
|
type EpisodeOut struct {
|
|
EpisodeNumber int `json:"episode_number"`
|
|
Title string `json:"title,omitempty"`
|
|
Requested *bool `json:"requested,omitempty"`
|
|
Available *bool `json:"available,omitempty"`
|
|
}
|
|
|
|
type SeasonOut struct {
|
|
SeasonNumber int `json:"season_number"`
|
|
Episodes []EpisodeOut `json:"episodes"`
|
|
Truncated bool `json:"truncated"`
|
|
}
|
|
|
|
type Media struct {
|
|
Media string `json:"media"` // movie|tv|artist|album|person|collection|unknown
|
|
Identifiers []Identifier `json:"identifiers"`
|
|
Title string `json:"title,omitempty"`
|
|
Overview string `json:"overview,omitempty"`
|
|
Year *int `json:"year,omitempty"`
|
|
Available *bool `json:"available,omitempty"`
|
|
Requested *bool `json:"requested,omitempty"`
|
|
RequestTargets []OutTarget `json:"request_targets,omitempty"`
|
|
Genres []string `json:"genres,omitempty"`
|
|
Credits []Credit `json:"credits,omitempty"`
|
|
Providers []Provider `json:"providers,omitempty"`
|
|
Ratings []Reference `json:"ratings,omitempty"`
|
|
Seasons []SeasonOut `json:"seasons,omitempty"`
|
|
ArtworkURIs []string `json:"artwork_uris,omitempty"`
|
|
}
|
|
|
|
type Request struct {
|
|
Target OutTarget `json:"target"`
|
|
ParentRequestID *int `json:"parent_request_id,omitempty"`
|
|
Title string `json:"title,omitempty"`
|
|
Identifiers []Identifier `json:"identifiers,omitempty"`
|
|
Approved *bool `json:"approved,omitempty"`
|
|
Available *bool `json:"available,omitempty"`
|
|
Denied *bool `json:"denied,omitempty"`
|
|
StatusText string `json:"status_text,omitempty"`
|
|
RequestedDate string `json:"requested_date,omitempty"`
|
|
RequestedUserID string `json:"requested_user_id,omitempty"`
|
|
DeniedReason string `json:"denied_reason,omitempty"`
|
|
Is4K *bool `json:"is_4k,omitempty"`
|
|
Approved4K *bool `json:"approved_4k,omitempty"`
|
|
Available4K *bool `json:"available_4k,omitempty"`
|
|
Denied4K *bool `json:"denied_4k,omitempty"`
|
|
Subscribed *bool `json:"subscribed,omitempty"`
|
|
CanApprove *bool `json:"can_approve,omitempty"`
|
|
Seasons []SeasonOut `json:"seasons,omitempty"`
|
|
}
|
|
|
|
type Issue struct {
|
|
ID int `json:"id"`
|
|
Title string `json:"title,omitempty"`
|
|
Subject string `json:"subject,omitempty"`
|
|
Description string `json:"description,omitempty"`
|
|
CategoryID *int `json:"category_id,omitempty"`
|
|
Status string `json:"status,omitempty"`
|
|
StatusCode *int `json:"status_code,omitempty"`
|
|
RequestType string `json:"request_type,omitempty"`
|
|
RequestTypeCode *int `json:"request_type_code,omitempty"`
|
|
RequestID *int `json:"request_id,omitempty"`
|
|
ProviderID string `json:"provider_id,omitempty"`
|
|
CreatedDate string `json:"created_date,omitempty"`
|
|
ResolvedDate string `json:"resolved_date,omitempty"`
|
|
ReportedByUserID string `json:"reported_by_user_id,omitempty"`
|
|
}
|
|
|
|
type Comment struct {
|
|
ID *int `json:"id,omitempty"`
|
|
IssueID *int `json:"issue_id,omitempty"`
|
|
Comment string `json:"comment"`
|
|
AuthorID string `json:"author_id,omitempty"`
|
|
CreatedDate string `json:"created_date,omitempty"`
|
|
}
|
|
|
|
type Group struct {
|
|
ProviderID string `json:"provider_id,omitempty"`
|
|
Title string `json:"title,omitempty"`
|
|
Count *int `json:"count,omitempty"`
|
|
Issues []Issue `json:"issues,omitempty"`
|
|
}
|
|
|
|
type Vote struct {
|
|
RequestID *int `json:"request_id,omitempty"`
|
|
Media string `json:"media,omitempty"`
|
|
UserID string `json:"user_id,omitempty"`
|
|
VoteCode *int `json:"vote_code,omitempty"`
|
|
Up *int `json:"up,omitempty"`
|
|
Down *int `json:"down,omitempty"`
|
|
}
|
|
|
|
type User struct {
|
|
ID string `json:"id"`
|
|
UserName string `json:"user_name,omitempty"`
|
|
Alias string `json:"alias,omitempty"`
|
|
Language string `json:"language,omitempty"`
|
|
StreamingCountry string `json:"streaming_country,omitempty"`
|
|
Online *bool `json:"online,omitempty"`
|
|
}
|
|
|
|
type CalendarEntry struct {
|
|
Title string `json:"title,omitempty"`
|
|
Date string `json:"date,omitempty"`
|
|
Media string `json:"media,omitempty"` // movie|tv|unknown
|
|
Identifiers []Identifier `json:"identifiers,omitempty"`
|
|
SeasonNumber *int `json:"season_number,omitempty"`
|
|
EpisodeNumber *int `json:"episode_number,omitempty"`
|
|
Available *bool `json:"available,omitempty"`
|
|
}
|
|
|
|
type Artwork struct {
|
|
URI string `json:"uri"`
|
|
MimeType string `json:"mime_type,omitempty"`
|
|
Name string `json:"name"`
|
|
Kind string `json:"kind,omitempty"`
|
|
}
|
|
|
|
type RetryEntry struct {
|
|
QueueID int `json:"queue_id"`
|
|
RequestID *int `json:"request_id,omitempty"`
|
|
RequestType string `json:"request_type,omitempty"`
|
|
RequestTypeCode *int `json:"request_type_code,omitempty"`
|
|
Title string `json:"title,omitempty"`
|
|
Reason string `json:"reason,omitempty"`
|
|
}
|
|
|
|
type Paging struct {
|
|
Offset int `json:"offset"`
|
|
Limit int `json:"limit"`
|
|
Returned int `json:"returned"`
|
|
Total *int `json:"total"`
|
|
HasMore *bool `json:"has_more"`
|
|
NextOffset *int `json:"next_offset"`
|
|
Mode string `json:"mode"` // upstream|local|none
|
|
Unit string `json:"unit"` // media|requests|issues|provider_groups|comments|users|references|votes|calendar_entries|artwork|queue_entries
|
|
}
|
|
|
|
type MediaPage struct {
|
|
Kind string `json:"kind"` // const media_page
|
|
Items []Media `json:"items"`
|
|
Page *Paging `json:"page"`
|
|
}
|
|
|
|
type RequestPage struct {
|
|
Kind string `json:"kind"`
|
|
Items []Request `json:"items"`
|
|
Page *Paging `json:"page"`
|
|
}
|
|
|
|
type IssuePage struct {
|
|
Kind string `json:"kind"`
|
|
Items []Issue `json:"items"`
|
|
Page *Paging `json:"page"`
|
|
}
|
|
|
|
type CommentPage struct {
|
|
Kind string `json:"kind"`
|
|
Items []Comment `json:"items"`
|
|
Page *Paging `json:"page"`
|
|
}
|
|
|
|
type GroupPage struct {
|
|
Kind string `json:"kind"`
|
|
Items []Group `json:"items"`
|
|
Page *Paging `json:"page"`
|
|
}
|
|
|
|
type VotePage struct {
|
|
Kind string `json:"kind"`
|
|
Items []Vote `json:"items"`
|
|
Page *Paging `json:"page"`
|
|
}
|
|
|
|
type UserPage struct {
|
|
Kind string `json:"kind"`
|
|
Items []User `json:"items"`
|
|
Page *Paging `json:"page"`
|
|
}
|
|
|
|
type CalendarPage struct {
|
|
Kind string `json:"kind"`
|
|
Items []CalendarEntry `json:"items"`
|
|
Page *Paging `json:"page"`
|
|
}
|
|
|
|
type ArtworkPage struct {
|
|
Kind string `json:"kind"`
|
|
Items []Artwork `json:"items"`
|
|
Page *Paging `json:"page"`
|
|
}
|
|
|
|
type RetryPage struct {
|
|
Kind string `json:"kind"`
|
|
Items []RetryEntry `json:"items"`
|
|
Page *Paging `json:"page"`
|
|
}
|
|
|
|
type ReferencePage struct {
|
|
Kind string `json:"kind"`
|
|
Items []Reference `json:"items"`
|
|
Page *Paging `json:"page"`
|
|
}
|
|
|
|
type Metric struct {
|
|
Name string `json:"name"`
|
|
Value any `json:"value"`
|
|
Scope string `json:"scope"` // instance|principal|selected_user|unknown
|
|
Unit string `json:"unit,omitempty"`
|
|
}
|
|
|
|
type Metrics struct {
|
|
Kind string `json:"kind"` // const metrics
|
|
Values []Metric `json:"values"`
|
|
}
|
|
|
|
type Change struct {
|
|
Name string `json:"name"`
|
|
Value any `json:"value"`
|
|
}
|
|
|
|
type Settings struct {
|
|
Kind string `json:"kind"` // const settings
|
|
Section string `json:"section"`
|
|
Revision string `json:"revision,omitempty"`
|
|
Values []Change `json:"values"`
|
|
OmittedFields []string `json:"omitted_fields"`
|
|
}
|
|
|
|
type ItemResult struct {
|
|
Identifier string `json:"identifier"`
|
|
Outcome string `json:"outcome"` // completed|accepted|unknown|rejected
|
|
Message string `json:"message,omitempty"`
|
|
}
|
|
|
|
type Mutation struct {
|
|
Kind string `json:"kind"` // const mutation
|
|
Outcome string `json:"outcome"` // completed|accepted|partial|unknown|rejected
|
|
Target *OutTarget `json:"target,omitempty"`
|
|
RequestID *int `json:"request_id,omitempty"`
|
|
IssueID *int `json:"issue_id,omitempty"`
|
|
CommentID *int `json:"comment_id,omitempty"`
|
|
CategoryID *int `json:"category_id,omitempty"`
|
|
UserID string `json:"user_id,omitempty"`
|
|
QueueID *int `json:"queue_id,omitempty"`
|
|
Message string `json:"message,omitempty"`
|
|
UpstreamResult *bool `json:"upstream_result,omitempty"`
|
|
UpstreamIsError *bool `json:"upstream_is_error,omitempty"`
|
|
UpstreamErrorCode *int `json:"upstream_error_code,omitempty"`
|
|
AffectedCount *int `json:"affected_count,omitempty"`
|
|
ItemResults []ItemResult `json:"item_results,omitempty"`
|
|
}
|
|
|
|
type LogFile struct {
|
|
FileID string `json:"file_id"`
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
type Logs struct {
|
|
Kind string `json:"kind"` // const logs
|
|
Files []LogFile `json:"files,omitempty"`
|
|
Lines []string `json:"lines,omitempty"`
|
|
Offset *int `json:"offset,omitempty"`
|
|
NextOffset *int `json:"next_offset"`
|
|
Truncated bool `json:"truncated"`
|
|
}
|