goverseerr

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 8, 2021 License: GPL-3.0 Imports: 7 Imported by: 7

README

GOverseerr

A GoLang package for interaction with the Plex management tool Overseerr

Uses

  • Overseerr Prometheus Exporter - on github
  • OverCLIrr - A command line Overseerr tool - on github

Using GOverseerr

import "github.com/willfantom/goverseerr"

Documentation

Index

Constants

View Source
const PosterPathBase string = "https://image.tmdb.org/t/p/w600_and_h900_bestv2"

Variables

This section is empty.

Functions

This section is empty.

Types

type About

type About struct {
	Version         string `json:"version"`
	TotalRequests   int    `json:"totalRequests"`
	TotalMediaItems int    `json:"totalMediaItems"`
	TimeZone        string `json:"tz"`
}

type AppData

type AppData struct {
	Configured bool   `json:"appData"`
	Path       string `json:"appDataPath"`
}

type Cache

type Cache struct {
	ID    string     `json:"id"`
	Name  string     `json:"name"`
	Stats CacheStats `json:"stats"`
}

type CacheStats

type CacheStats struct {
	Hits   int `json:"hits"`
	Misses int `json:"misses"`
	Keys   int `json:"keys"`
	KSize  int `json:"ksize"`
	VSize  int `json:"vsize"`
}

type Cast

type Cast struct {
	ID          int    `json:"id"`
	CastID      int    `json:"castId"`
	Character   string `json:"character"`
	CreditID    string `json:"creditId"`
	Gender      int    `json:"gender"`
	Name        string `json:"name"`
	Order       int    `json:"order"`
	ProfilePath string `json:"profilePath"`
}

type Collection

type Collection struct {
	ID           int           `json:"id"`
	Name         string        `json:"name"`
	Overview     string        `json:"overview"`
	PosterPath   string        `json:"posterPath"`
	BackdropPath string        `json:"backdropPath"`
	Parts        []MovieResult `json:"parts"`
}

type Creator

type Creator struct {
	ID          int    `json:"id"`
	Name        string `json:"name"`
	Gender      int    `json:"gender"`
	ProfilePath string `json:"profilePath"`
}

type Credits

type Credits struct {
	Cast []Cast `json:"cast"`
	Crew []Crew `json:"crew"`
}

type Crew

type Crew struct {
	ID          int    `json:"id"`
	CreditID    string `json:"creditId"`
	Gender      int    `json:"gender"`
	Name        string `json:"name"`
	Job         string `json:"job"`
	Department  string `json:"department"`
	ProfilePath string `json:"profilePath"`
}

type Episode

type Episode struct {
	ID             int     `json:"id"`
	Name           string  `json:"name"`
	AirDate        string  `json:"airDate"`
	Number         int     `json:"episodeNumber"`
	Overview       string  `json:"overview"`
	ProductionCode string  `json:"productionCode"`
	SeasonNumber   int     `json:"seasonNumber"`
	ShowID         int     `json:"showId"`
	StillPath      string  `json:"stillPath"`
	VoteAverage    float64 `json:"voteAverage"`
	VoteCount      float64 `json:"voteCount"`
}

type ExternalIDs

type ExternalIDs struct {
	Facebook  string `json:"facebookId"`
	Freebase  string `json:"freebaseId"`
	IMDB      string `json:"imdbId"`
	Instagram string `json:"instagramId"`
	TVDB      int    `json:"tvdbId"`
	Twitter   string `json:"twitterId"`
}

type FriendlyMediaRequest

type FriendlyMediaRequest struct {
	ID               int
	Status           string
	StatusEmoji      string
	MediaType        string
	MediaTypeEmoji   string
	CreatorEmail     string
	CreatedDate      string
	ContentTitle     string
	ContentDate      string
	MediaStatus      string
	MediaStatusEmoji string
}

type GenerealUserSettings

type GenerealUserSettings struct {
	Username        string `json:"username"`
	MovieQuotaLimit int    `json:"movieQuotaLimit"`
	MovieQuotaDays  int    `json:"movieQuotaDays"`
	TVQuotaLimit    int    `json:"tvQuotaLimit"`
	TVQuotaDays     int    `json:"tvQuotaDays"`
}

type GenericSearchResult

type GenericSearchResult struct {
	ID               int       `json:"id" mapstructure:"id"`
	MediaType        MediaType `json:"mediaType" mapstructure:"mediaType"`
	MediaInfo        MediaInfo `json:"mediaInfo" mapstructure:"mediaInfo"`
	Name             string    `json:"name" mapstructure:"name"`
	Popularity       float64   `json:"popularity" mapstructure:"popularity"`
	Adult            bool      `json:"adult" mapstructure:"adult"`
	PosterPath       string    `json:"posterPath" mapstructure:"posterPath"`
	BackdropPath     string    `json:"backdropPath" mapstructure:"backdropPath"`
	VoteCount        int       `json:"voteCount" mapstructure:"voteCount"`
	VoteAverage      float64   `json:"voteAverage" mapstructure:"voteAverage"`
	GenreIDs         []int     `json:"genreIds" mapstructure:"genreIds"`
	Overview         string    `json:"overview" mapstructure:"overview"`
	OriginalLanguage string    `json:"originalLanguage" mapstructure:"originalLanguage"`
	OriginalTitle    string    `json:"originalTitle" mapstructure:"originalTitle"`
	MovieResult
	TVResult
	PersonResult
}

GenericSearchResult represents a single search result item

type Genre

type Genre struct {
	ID        int      `json:"id"`
	Name      string   `json:"name"`
	Backdrops []string `json:"backdrops,omitempty"`
}

type Job

type Job struct {
	ID          string
	Name        string
	Type        JobType
	NextRunTime time.Time
	Running     bool
}

type JobType

type JobType string
const (
	JobTypeProcess JobType = "process"
	JobTypeCommand JobType = "command"
)

type Keyword

type Keyword struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

type LanguageProfile

type LanguageProfile struct {
	ID             int    `json:"id"`
	Name           string `json:"name"`
	UpgradeAllowed bool   `json:"upgradeAllowed"`
}

type LogLevel

type LogLevel string
const (
	LogLevelDebug LogLevel = "debug"
	LogLevelInfo  LogLevel = "info"
	LogLevelWarn  LogLevel = "warn"
	LogLevelError LogLevel = "error"
)

func StringToLogLevel

func StringToLogLevel(level string) (LogLevel, error)

type LogMessage

type LogMessage struct {
	Label     string    `json:"label"`
	Level     LogLevel  `json:"level"`
	Message   string    `json:"message"`
	Timestamp time.Time `json:"timestamp"`
}

type LogResponse

type LogResponse struct {
	PageInfo Page          `json:"pageInfo"`
	Entries  []*LogMessage `json:"results"`
}

type MainSettings

type MainSettings struct {
	APIKey                 string `json:"apiKey"`
	AppTitle               string `json:"applicationTitle"`
	AppURL                 string `json:"applicationUrl"`
	TrustProxy             bool   `json:"trustProxy"`
	CSRFProtection         bool   `json:"csrfProtection"`
	HideAvailable          bool   `json:"hideAvailable"`
	PartialRequestsEnabled bool   `json:"partialRequestsEnabled"`
	LocalLogin             bool   `json:"localLogin"`
	DefaultPermissions     int    `json:"defaultPermissions"`
}

type MediaInfo

type MediaInfo struct {
	ID         int            `json:"id"`
	TMDB       int            `json:"tmdbID"`
	TVDB       int            `json:"tvdbID"`
	MediaType  MediaType      `json:"mediaType"`
	Status     MediaStatus    `json:"status"`
	Created    time.Time      `json:"createdAt"`
	Modified   time.Time      `json:"updatedAt"`
	Requests   []MediaRequest `json:"requests"`
	PlexURL    string         `json:"plexUrl"`
	ServiceURL string         `json:"serviceUrl"`
}

func (MediaInfo) IsMovie

func (i MediaInfo) IsMovie() bool

func (MediaInfo) IsPerson

func (i MediaInfo) IsPerson() bool

func (MediaInfo) IsTV

func (i MediaInfo) IsTV() bool

type MediaQuota

type MediaQuota struct {
	Days       int  `json:"days"`
	Limit      int  `json:"limit"`
	Used       int  `json:"used"`
	Remaining  int  `json:"remaining"`
	Restricted bool `json:"restricted"`
}

type MediaRequest

type MediaRequest struct {
	ID          int           `json:"id"`
	Status      RequestStatus `json:"status"`
	Media       MediaInfo     `json:"media"`
	Created     time.Time     `json:"createdAt"`
	Modified    time.Time     `json:"updatedAt"`
	Creator     User          `json:"requestedBy"`
	LastModifer User          `json:"updatedBy"`
	IsUHD       bool          `json:"is4k"`
	RootFolder  string        `json:"rootFolder"`
	ServerID    int           `json:"serverId"`
	ProfileID   int           `json:"profileID"`
}

func (MediaRequest) GetMovieDetails

func (req MediaRequest) GetMovieDetails(o *Overseerr) (*MovieDetails, error)

func (MediaRequest) GetTVDetails

func (req MediaRequest) GetTVDetails(o *Overseerr) (*TVDetails, error)

func (MediaRequest) ToFriendly

func (req MediaRequest) ToFriendly(o *Overseerr) (*FriendlyMediaRequest, error)

type MediaRequestResponse

type MediaRequestResponse struct {
	PageInfo Page            `json:"pageInfo"`
	Results  []*MediaRequest `json:"results"`
}

type MediaStatus

type MediaStatus int
const (
	MediaStatusUnknown    MediaStatus = 0
	MediaStatusPending    MediaStatus = 1
	MediaStatusProcessing MediaStatus = 3
	MediaStatusPartial    MediaStatus = 4
	MediaStatusAvailable  MediaStatus = 5
)

func (MediaStatus) ToEmoji

func (s MediaStatus) ToEmoji() string

func (MediaStatus) ToString

func (s MediaStatus) ToString() string

type MediaType

type MediaType string
const (
	MediaTypeTV     MediaType = "tv"
	MediaTypeMovie  MediaType = "movie"
	MediaTypePerson MediaType = "person"
)

func (MediaType) ToEmoji

func (mt MediaType) ToEmoji() string

type MovieDetails

type MovieDetails struct {
	ID                  int                 `json:"id"`
	Title               string              `json:"title"`
	Adult               bool                `json:"adult"`
	IMDBID              string              `json:"imdbId"`
	ReleaseDate         string              `json:"releaseDate"`
	Genres              []Genre             `json:"genres"`
	Overview            string              `json:"overview"`
	BackdropPath        string              `json:"backdropPath"`
	PosterPath          string              `json:"posterPath"`
	Budget              int                 `json:"budget"`
	Homepage            string              `json:"homepage"`
	RelatedVideos       []RelatedVideo      `json:"relatedVideos"`
	OriginalLanguage    string              `json:"originalLanguage"`
	OriginalTitle       string              `json:"originalTitle"`
	Popularity          float64             `json:"popularity"`
	ProductionCompanies []ProductionCompany `json:"productionCompanies"`
	Revenue             int                 `json:"revenue"`
	Runtime             int                 `json:"runtime"`
	SpokenLanguages     []SpokenLanguage    `json:"spokenLanguages"`
	Status              string              `json:"status"`
	Tagline             string              `json:"tagline"`
	Video               bool                `json:"video"`
	VoteAverage         float64             `json:"voteAverage"`
	VoteCount           int                 `json:"voteCount"`
	Credits             Credits             `json:"credits"`
	Collection          Collection          `json:"collection"`
	ExternalIDs         ExternalIDs         `json:"externalIds"`
	MediaInfo           MediaInfo           `json:"mediaInfo"`
}

type MovieResult

type MovieResult struct {
	Title       string `json:"title" mapstructure:"title"`
	ReleaseDate string `json:"releaseDate" mapstructure:"releaseDate"`
	Video       bool   `json:"video" mapstructure:"video"`
}

type Network

type Network struct {
	ID            int    `json:"id"`
	LogoPath      string `json:"logoPath"`
	OriginCountry string `json:"originCountry"`
	Name          string `json:"name"`
	Description   string `json:"description"`
	Headquaters   string `json:"headquesters"`
	Homepage      string `json:"homepage"`
}

type NewRequest

type NewRequest struct {
	MediaType         string `json:"mediaType"`
	MediaID           int    `json:"mediaId"`
	TVDBID            int    `json:"tvdbId"`
	Seasons           []int  `json:"seasons"`
	UHD               bool   `json:"is4k"`
	ServerID          int    `json:"serverId"`
	ProfileID         int    `json:"profileId"`
	RootFolder        string `json:"rootFolder"`
	LanguageProfileID int    `json:"languageProfileId"`
}

type Overseerr

type Overseerr struct {
	URL string
	// contains filtered or unexported fields
}

func NewKeyAuth

func NewKeyAuth(url string, customHeaders map[string]string, locale string, apikey string) (*Overseerr, error)

NewKeyAuth creates a new Overseerr client with the X-Api-Key header set. An error is returned alongside the client if an auth check fails.

func NewLocalAuth

func NewLocalAuth(url string, customHeaders map[string]string, locale string, email, password string) (*Overseerr, error)

NewLocalAuth creates a new Overseerr client with the session cookie for auth. The cookie is generated via an API call that requires and email and password. An error is returned alongside the client if an auth check fails.

func NewPlexAuth

func NewPlexAuth(url string, customHeaders map[string]string, locale string, plexToken string) (*Overseerr, error)

NewPlexAuth creates a new Overseerr client with the session cookie for auth. The cookie is generated via an API call that requires a plex toke. An error is returned alongside the client if an auth check fails.

func (*Overseerr) AddRadarr

func (o *Overseerr) AddRadarr(settings RadarrSettings) (*RadarrSettings, error)

func (*Overseerr) AddSonarr

func (o *Overseerr) AddSonarr(settings SonarrSettings) (*SonarrSettings, error)

func (*Overseerr) ApproveRequest

func (o *Overseerr) ApproveRequest(requestID int) (*MediaRequest, error)

func (*Overseerr) CancelJob

func (o *Overseerr) CancelJob(jobID string) (*Job, error)

func (*Overseerr) CancelPlexSync

func (o *Overseerr) CancelPlexSync() error

func (*Overseerr) CreateNewUser

func (o *Overseerr) CreateNewUser(newUser User) (*User, error)

func (*Overseerr) CreateRequest

func (o *Overseerr) CreateRequest(request NewRequest) (*MediaRequest, error)

func (*Overseerr) DeclineRequest

func (o *Overseerr) DeclineRequest(requestID int) (*MediaRequest, error)

func (*Overseerr) DeleteRadarr

func (o *Overseerr) DeleteRadarr(radarrID int) error

func (*Overseerr) DeleteRequest

func (o *Overseerr) DeleteRequest(requestID int) error

func (*Overseerr) DeleteSonarr

func (o *Overseerr) DeleteSonarr(sonarrID int) error

func (*Overseerr) DeleteUser

func (o *Overseerr) DeleteUser(userID int) (*User, error)

func (*Overseerr) DiscoverMovies

func (o *Overseerr) DiscoverMovies(pageNumber int) (*SearchResults, error)

func (*Overseerr) DiscoverMoviesByGenre

func (o *Overseerr) DiscoverMoviesByGenre(pageNumber, genreID int) (*SearchResults, error)

func (*Overseerr) DiscoverMoviesByStudio

func (o *Overseerr) DiscoverMoviesByStudio(pageNumber, studioID int) (*SearchResults, error)

func (*Overseerr) DiscoverTV

func (o *Overseerr) DiscoverTV(pageNumber int) (*SearchResults, error)

func (*Overseerr) DiscoverTVByGenre

func (o *Overseerr) DiscoverTVByGenre(pageNumber, genreID int) (*SearchResults, error)

func (*Overseerr) DiscoverTVByNetwork

func (o *Overseerr) DiscoverTVByNetwork(pageNumber, networkID int) (*SearchResults, error)

func (*Overseerr) DiscoverTrending

func (o *Overseerr) DiscoverTrending(pageNumber int) (*SearchResults, error)

func (*Overseerr) DiscoverUpcomingMovies

func (o *Overseerr) DiscoverUpcomingMovies(pageNumber int) (*SearchResults, error)

func (*Overseerr) DiscoverUpcomingTV

func (o *Overseerr) DiscoverUpcomingTV(pageNumber int) (*SearchResults, error)

func (*Overseerr) FlushCache

func (o *Overseerr) FlushCache(cacheID string) error

func (*Overseerr) GetAbout

func (o *Overseerr) GetAbout() (*About, error)

func (*Overseerr) GetAllRadarrProfiles

func (o *Overseerr) GetAllRadarrProfiles(radarrID int) ([]*ServiceProfile, error)

func (*Overseerr) GetAllUsers

func (o *Overseerr) GetAllUsers(pageSize, pageNumber int) ([]*User, *Page, error)

func (*Overseerr) GetAppData

func (o *Overseerr) GetAppData() (*AppData, error)

func (*Overseerr) GetCacheStats

func (o *Overseerr) GetCacheStats() ([]*Cache, error)

func (*Overseerr) GetJobs

func (o *Overseerr) GetJobs() ([]*Job, error)

func (*Overseerr) GetLoggedInUser

func (o *Overseerr) GetLoggedInUser() (*User, error)

func (*Overseerr) GetLogs

func (o *Overseerr) GetLogs(take, skip int, filter LogLevel) ([]*LogMessage, error)

func (*Overseerr) GetMainSettings

func (o *Overseerr) GetMainSettings() (*MainSettings, error)

func (*Overseerr) GetMovie

func (*Overseerr) GetMovieDetails

func (o *Overseerr) GetMovieDetails(movieID int) (*MovieDetails, error)

func (*Overseerr) GetMovieRatings

func (o *Overseerr) GetMovieRatings(movieID int) (*Rating, error)

func (*Overseerr) GetMovieRecommendations

func (o *Overseerr) GetMovieRecommendations(movieID, page int) (*SearchResults, error)

func (*Overseerr) GetMovieSimilar

func (o *Overseerr) GetMovieSimilar(movieID, page int) (*SearchResults, error)

func (*Overseerr) GetPersonDetails

func (o *Overseerr) GetPersonDetails(personID int) (*PersonDetails, error)

func (*Overseerr) GetPlexLibraries

func (o *Overseerr) GetPlexLibraries() ([]*PlexLibrary, error)

func (*Overseerr) GetPlexServers

func (o *Overseerr) GetPlexServers() ([]*PlexDevice, error)

func (*Overseerr) GetPlexSettings

func (o *Overseerr) GetPlexSettings() (*PlexSettings, error)

func (*Overseerr) GetPlexSyncStatus

func (o *Overseerr) GetPlexSyncStatus() (*PlexSyncStatus, error)

func (*Overseerr) GetPublicSettings

func (o *Overseerr) GetPublicSettings() (*PublicSettings, error)

func (*Overseerr) GetRadarrProfiles

func (o *Overseerr) GetRadarrProfiles(radarrID int) (*RadarrService, error)

func (*Overseerr) GetRadarrServers

func (o *Overseerr) GetRadarrServers() ([]*RadarrSettings, error)

func (*Overseerr) GetRadarrSettings

func (o *Overseerr) GetRadarrSettings() ([]*RadarrSettings, error)

func (*Overseerr) GetRequest

func (o *Overseerr) GetRequest(requestID int) (*MediaRequest, error)

func (*Overseerr) GetRequestCounts

func (o *Overseerr) GetRequestCounts() (*RequestCounts, error)

func (*Overseerr) GetRequests

func (o *Overseerr) GetRequests(pageNumber, pageSize int, filter RequestFilter, sort RequestSort) ([]*MediaRequest, *Page, error)

func (*Overseerr) GetRequestsByUser

func (o *Overseerr) GetRequestsByUser(pageNumber, pageSize, userID int, filter RequestFilter, sort RequestSort) ([]*MediaRequest, *Page, error)

func (*Overseerr) GetSonarrProfiles

func (o *Overseerr) GetSonarrProfiles(sonarrID int) (*SonarrService, error)

func (*Overseerr) GetSonarrServers

func (o *Overseerr) GetSonarrServers() ([]*SonarrSettings, error)

func (*Overseerr) GetSonarrSettings

func (o *Overseerr) GetSonarrSettings() ([]*SonarrSettings, error)

func (*Overseerr) GetTV

func (*Overseerr) GetTVDetails

func (o *Overseerr) GetTVDetails(tvID int) (*TVDetails, error)

func (*Overseerr) GetTVRatings

func (o *Overseerr) GetTVRatings(tvID int) (*Rating, error)

func (*Overseerr) GetTVRecommendations

func (o *Overseerr) GetTVRecommendations(tvID, page int) (*SearchResults, error)

func (*Overseerr) GetTVSeason

func (o *Overseerr) GetTVSeason(tvID, seasonID int) (*Season, error)

func (*Overseerr) GetTVSimilar

func (o *Overseerr) GetTVSimilar(tvID, page int) (*SearchResults, error)

func (*Overseerr) GetUser

func (o *Overseerr) GetUser(userID int) (*User, error)

func (*Overseerr) GetUserGeneralSettings

func (o *Overseerr) GetUserGeneralSettings(userID int) (*GenerealUserSettings, error)

func (*Overseerr) GetUserQuota

func (o *Overseerr) GetUserQuota(userID int) (*UserQuota, error)

func (*Overseerr) GetUserRequests

func (o *Overseerr) GetUserRequests(userID int, pageNumber, pageSize int) ([]*MediaRequest, *Page, error)

func (*Overseerr) HealthCheck

func (o *Overseerr) HealthCheck() bool

HealthCheck ensures an Overseerr instance is accessible and that the API key provided is valid

func (*Overseerr) ImportPlexUsers

func (o *Overseerr) ImportPlexUsers() ([]*User, error)

func (*Overseerr) MovieGenres

func (o *Overseerr) MovieGenres() ([]*Genre, error)

func (*Overseerr) RegenerateMainSettings

func (o *Overseerr) RegenerateMainSettings() (*MainSettings, error)

func (*Overseerr) RegisterPostResponseMiddleware

func (o *Overseerr) RegisterPostResponseMiddleware(middleware func(c *resty.Client, resp *resty.Response) error)

RegisterPostResponseMiddleware allows for a custom function to be called after each request. Useful for logging.

func (*Overseerr) RegisterPreRequestMiddleware

func (o *Overseerr) RegisterPreRequestMiddleware(middleware func(c *resty.Client, req *resty.Request) error)

RegisterPreRequestMiddleware allows for a custom function to be called before each request. Useful for logging.

func (*Overseerr) RegisterRequestErrorMiddleware

func (o *Overseerr) RegisterRequestErrorMiddleware(middleware func(req *resty.Request, err error))

RegisterRequestErrorMiddleware allows for a custom function to be called if a request encounters an error. Useful for logging.

func (*Overseerr) RetryRequest

func (o *Overseerr) RetryRequest(requestID int) (*MediaRequest, error)

func (*Overseerr) RunJob

func (o *Overseerr) RunJob(jobID string) (*Job, error)

func (*Overseerr) Search

func (o *Overseerr) Search(query string, pageNumber int) (*SearchResults, error)

func (*Overseerr) SetBasicAuth

func (o *Overseerr) SetBasicAuth(user, pass string)

SetBasicAuth allows requests to the Overseerr instance to get past basic authentication using a given username and password

func (*Overseerr) SetProxy

func (o *Overseerr) SetProxy(proxyURL string) error

SetProxy forces all requests to the Overseerr to go via the given proxy and removes the proxy if a blank string is given

func (*Overseerr) SetUserAgent

func (o *Overseerr) SetUserAgent(ua string)

SetUserAgent allows requests to the Overseerr instance to bypass any security that checks the user agent

func (*Overseerr) SetUserGeneralSettings

func (o *Overseerr) SetUserGeneralSettings(userID int, new GenerealUserSettings) error

func (*Overseerr) Status

func (o *Overseerr) Status() (*Status, error)

func (*Overseerr) TVGenres

func (o *Overseerr) TVGenres() ([]*Genre, error)

func (*Overseerr) TestRadarr

func (o *Overseerr) TestRadarr(settings RadarrSettings) error

func (*Overseerr) TestSonarr

func (o *Overseerr) TestSonarr(settings SonarrSettings) error

func (*Overseerr) TriggerPlexSync

func (o *Overseerr) TriggerPlexSync() error

func (*Overseerr) UpdateMainSettings

func (o *Overseerr) UpdateMainSettings(newSettings MainSettings) (*MainSettings, error)

func (*Overseerr) UpdatePlexSettings

func (o *Overseerr) UpdatePlexSettings(newSettings PlexSettings) error

func (*Overseerr) UpdateRadarrSettings

func (o *Overseerr) UpdateRadarrSettings(newSettings RadarrSettings, radarrID int) error

func (*Overseerr) UpdateRequest

func (o *Overseerr) UpdateRequest(requestID int, request MediaRequest) (*MediaRequest, error)

func (*Overseerr) UpdateSonarrSettings

func (o *Overseerr) UpdateSonarrSettings(newSettings SonarrSettings, sonarrID int) error

func (*Overseerr) UpdateUser

func (o *Overseerr) UpdateUser(userID int, updatedUser User) (*User, error)

type Page

type Page struct {
	Page    int `json:"page"`
	Pages   int `json:"pages"`
	Results int `json:"results"`
}

type PersonDetails

type PersonDetails struct {
	ID           int      `json:"id"`
	Name         string   `json:"name"`
	DeathDay     string   `json:"deathday"`
	AKA          []string `json:"alsoKnownAs"`
	Gender       string   `json:"gender"`
	Bio          string   `json:"biography"`
	Popularity   string   `json:"popularity"`
	PlaceOfBirth string   `json:"placeOfBirth"`
	ProfilePath  string   `json:"profilePath"`
	Adult        bool     `json:"adult"`
	IMDBID       string   `json:"imdbId"`
	Homepage     string   `json:"homepage"`
}

type PersonResult

type PersonResult struct {
	ProfilePath string        `json:"profilePath" mapstructure:"profilePath"`
	KnownFor    []interface{} `json:"knownFor" mapstructure:"knownFor"`
}

type PlexConnection

type PlexConnection struct {
	Protocol string `json:"protocol"`
	Address  string `json:"address"`
	Port     int    `json:"port"`
	URI      string `json:"uri"`
	Local    bool   `json:"local"`
	Status   int    `json:"status"`
	Message  string `json:"message"`
}

type PlexDevice

type PlexDevice struct {
	Name                   string         `json:"name"`
	Product                string         `json:"product"`
	ProductVersion         string         `json:"productVersion"`
	Platform               string         `json:"platform"`
	PlatformVersion        string         `json:"platformVersion"`
	Device                 string         `json:"device"`
	ClientIdentifier       string         `json:"clientIdentifier"`
	Created                time.Time      `json:"createdAt"`
	LastSeen               time.Time      `json:"lastSeenAt"`
	Provides               []string       `json:"provides"`
	Owned                  bool           `json:"owned"`
	OwnerID                string         `json:"ownerId"`
	Home                   bool           `json:"home"`
	SourceTitle            string         `json:"sourceTitle"`
	AccessToken            string         `json:"accessToken"`
	PublicAddress          string         `json:"publicAddress"`
	HTTPSRequired          bool           `json:"httpsRequired"`
	Synced                 bool           `json:"synced"`
	Relay                  bool           `json:"relay"`
	DNSRebindingProtection bool           `json:"dnsRebindingProtection"`
	NATLoopbackSupported   bool           `json:"natLoopbackSupported"`
	PublicAddressMatches   bool           `json:"publicAddressMatches"`
	Presence               bool           `json:"presence"`
	Connection             PlexConnection `json:"connection"`
}

type PlexLibrary

type PlexLibrary struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	Enabled bool   `json:"enabled"`
}

type PlexSettings

type PlexSettings struct {
	Name      string        `json:"name"`
	MachineID string        `json:"machineId"`
	IP        string        `json:"ip"`
	Port      int           `json:"port"`
	Libraries []PlexLibrary `json:"libraries"`
	WebAppURL string        `json:"webAppUrl"`
}

type PlexSyncStatus

type PlexSyncStatus struct {
	Running        bool          `json:"running"`
	Progress       int           `json:"progress"`
	Total          int           `json:"total"`
	CurrentLibrary PlexLibrary   `json:"currentLibrary"`
	Libraries      []PlexLibrary `json:"libraries"`
}

type ProductionCompany

type ProductionCompany struct {
	ID            int    `json:"id"`
	LogoPath      string `json:"logoPath"`
	OriginCountry string `json:"originCountry"`
	Name          string `json:"name"`
	Description   string `json:"description"`
	Headquaters   string `json:"headquesters"`
	Homepage      string `json:"homepage"`
}

type PublicSettings

type PublicSettings struct {
	Initialized bool `json:"initialized"`
}

type RadarrService

type RadarrService struct {
	Server      RadarrSettings   `json:"server"`
	Profiles    []ServiceProfile `json:"profiles"`
	RootFolders []RootFolder     `json:"rootFolders"`
}

type RadarrSettings

type RadarrSettings struct {
	ID              int    `json:"id"`
	Name            string `json:"name"`
	Hostname        string `json:"hostname"`
	Port            int    `json:"port"`
	APIKey          string `json:"apiKey"`
	SSL             bool   `json:"useSsl"`
	BaseURL         string `json:"baseUrl"`
	ProfileID       int    `json:"activeProfileId"`
	ProfileName     string `json:"activeProfileName"`
	Directory       string `json:"activeDirectory"`
	UHD             bool   `json:"is4k"`
	MinAvailability string `json:"minimumAvailability"`
	Default         bool   `json:"isDefault"`
	ExternalURL     string `json:"externalUrl"`
	SyncEnabled     bool   `json:"syncEnabled"`
	PreventSearch   bool   `json:"preventSearch"`
}

type Rating

type Rating struct {
	Title          string `json:"title"`
	Year           int    `json:"year"`
	URL            string `json:"url"`
	CriticScore    int    `json:"criticsScore"`
	CriticRating   string `json:"criticsRating"`
	AudienceScore  int    `json:"audienceScore"`
	AudienceRating string `json:"audienceRating"`
}

type RelatedVideo

type RelatedVideo struct {
	URL  string           `json:"url"`
	Key  string           `json:"key"`
	Name string           `json:"name"`
	Size int              `json:"size"`
	Type RelatedVideoType `json:"type"`
	Site RelatedVideoSite `json:"site"`
}

type RelatedVideoSite

type RelatedVideoSite string
const (
	RelatedVideoSiteYoutube RelatedVideoSite = "YouTube"
)

type RelatedVideoType

type RelatedVideoType string
const (
	RelatedVideoTypeClip            RelatedVideoType = "Clip"
	RelatedVideoTypeTeaser          RelatedVideoType = "Teaser"
	RelatedVideoTypeTrailer         RelatedVideoType = "Trailer"
	RelatedVideoTypeFeaturette      RelatedVideoType = "Featurette"
	RelatedVideoTypeOpeningCredits  RelatedVideoType = "Opening Credits"
	RelatedVideoTypeBehindTheScenes RelatedVideoType = "Behind the Scenes"
	RelatedVideoTypeBloopers        RelatedVideoType = "Bloopers"
)

type RequestCounts

type RequestCounts struct {
	Pending    int `json:"pending"`
	Approved   int `json:"approved"`
	Processing int `json:"processing"`
	Available  int `json:"available"`
}

type RequestFilter

type RequestFilter string
const (
	RequestFileterAll         RequestFilter = "all"
	RequestFileterApproved    RequestFilter = "approved"
	RequestFileterPending     RequestFilter = "pending"
	RequestFileterAvailable   RequestFilter = "available"
	RequestFileterProcessing  RequestFilter = "processing"
	RequestFileterUnavailable RequestFilter = "unavailable"
)

type RequestSort

type RequestSort string
const (
	RequestSortAdded    RequestSort = "added"
	RequestSortModified RequestSort = "modified"
)

type RequestStatus

type RequestStatus int
const (
	RequestStatusPending   RequestStatus = 1
	RequestStatusApproved  RequestStatus = 2
	RequestStatusDeclined  RequestStatus = 3
	RequestStatusAvailable RequestStatus = 4
)

func StringToRequestStatus

func StringToRequestStatus(status string) RequestStatus

func (RequestStatus) ToEmoji

func (s RequestStatus) ToEmoji() string

func (RequestStatus) ToString

func (s RequestStatus) ToString() string

type RootFolder

type RootFolder struct {
	ID        int    `json:"id"`
	Path      string `json:"path"`
	FreeSpace int    `json:"freeSpace"`
}

type SearchResults

type SearchResults struct {
	Page         int                   `json:"page"`
	TotalPages   int                   `json:"totalPages"`
	TotalResults int                   `json:"totalResults"`
	Genre        Genre                 `json:"genre,omitempty"`
	Studio       ProductionCompany     `json:"studio,omitempty"`
	Network      Network               `json:"network,omitempty"`
	Results      []GenericSearchResult `json:"results"`
}

func (*SearchResults) SortByAdult

func (results *SearchResults) SortByAdult()

func (*SearchResults) SortByID

func (results *SearchResults) SortByID()

func (*SearchResults) SortByPopularity

func (results *SearchResults) SortByPopularity()

type Season

type Season struct {
	ID           int       `json:"id"`
	AirDate      string    `json:"airDate"`
	EpisodeCount int       `json:"episodeCount"`
	Name         string    `json:"name"`
	Overview     string    `json:"overview"`
	PosterPath   string    `json:"posterPath"`
	Number       int       `json:"seasonNumber"`
	Episodes     []Episode `json:"episodes"`
}

type ServiceProfile

type ServiceProfile struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

type SonarrService

type SonarrService struct {
	Server           SonarrSettings    `json:"server"`
	Profiles         []ServiceProfile  `json:"profiles"`
	RootFolders      []RootFolder      `json:"rootFolders"`
	LanguageProfiles []LanguageProfile `json:"languageProfiles"`
}

type SonarrSettings

type SonarrSettings struct {
	ID                     int    `json:"id"`
	Name                   string `json:"name"`
	Hostname               string `json:"hostname"`
	Port                   int    `json:"port"`
	APIKey                 string `json:"apiKey"`
	SSL                    bool   `json:"useSsl"`
	BaseURL                string `json:"baseUrl"`
	ProfileID              int    `json:"activeProfileId"`
	ProfileName            string `json:"activeProfileName"`
	Directory              string `json:"activeDirectory"`
	LanguageProfileId      int    `json:"activeLanguageProfileId"`
	AnimeProfileID         int    `json:"activeAnimeProfileId"`
	AnimeLanguageProfileId int    `json:"activeAnimeLanguageProfileId"`
	AnimeProfileName       string `json:"activeAnimeProfileName"`
	AnimeDirectory         string `json:"activeAnimeDirectory"`
	UHD                    bool   `json:"is4k"`
	MinAvailability        string `json:"minimumAvailability"`
	Default                bool   `json:"isDefault"`
	ExternalURL            string `json:"externalUrl"`
	SyncEnabled            bool   `json:"syncEnabled"`
	PreventSearch          bool   `json:"preventSearch"`
}

type SpokenLanguage

type SpokenLanguage struct {
	EnglishName string `json:"englishName"`
	Code        string `json:"iso_639_1"`
	Name        string `json:"name"`
}

type Status

type Status struct {
	Version   string `json:"version"`
	CommitTag string `json:"commitTag"`
}

type TVDetails

type TVDetails struct {
	ID                  int                 `json:"id"`
	Name                string              `json:"name"`
	TagLine             string              `json:"tagline"`
	IMDBID              string              `json:"imdbId"`
	InProduction        bool                `json:"inProduction"`
	Genres              []Genre             `json:"genres"`
	Overview            string              `json:"overview"`
	Creator             []Creator           `json:"createdBy"`
	FirstAired          string              `json:"firstAirDate"`
	EpisodeRuntime      []int               `json:"episodeRunTime"`
	Homepage            string              `json:"homepage"`
	Languages           []string            `json:"languages"`
	LastAired           string              `json:"lastAirDate"`
	LastAiredEpisode    Episode             `json:"lastEpisodeToAir"`
	NextEpisodeToAir    Episode             `json:"nextEpisodeToAir"`
	Networks            []Network           `json:"networks"`
	EpisodeCount        int                 `json:"numberOfEpisodes"`
	SeasonCount         int                 `json:"numberOfSeasons"`
	OriginCountry       []string            `json:"originCountry"`
	OriginalLanguage    string              `json:"originalLanguage"`
	OriginalName        string              `json:"originalName"`
	Popularity          float64             `json:"popularity"`
	ProductionCompanies []ProductionCompany `json:"productionCompanies"`
	SpokenLanguages     []SpokenLanguage    `json:"spokenLanguages"`
	Seasons             []Season            `json:"seasons"`
	Status              string              `json:"status"`
	Type                string              `json:"type"`
	VoteAverage         float64             `json:"voteAverage"`
	VoteCount           int                 `json:"voteCount"`
	Credits             Credits             `json:"credits"`
	ExternalIDs         ExternalIDs         `json:"externalIds"`
	KeyWords            []Keyword           `json:"keywords"`
	MediaInfo           MediaInfo           `json:"mediaInfo"`
	RelatedVideos       []RelatedVideo      `json:"relatedVideos"`
}

type TVResult

type TVResult struct {
	OriginCounty   []string `json:"originCountry" mapstructure:"originCountry"`
	FirstAiredDate string   `json:"firstAirDate" mapstructure:"firstAirDate"`
}

type User

type User struct {
	ID           int            `json:"id"`
	Email        string         `json:"email"`
	PlexToken    string         `json:"plexToken"`
	UserType     UserType       `json:"userType"`
	RequestCount int            `json:"requestCount"`
	Requests     []MediaRequest `json:"requests"`
	Avatar       string         `json:"avatar"`
	Created      time.Time      `json:"createdAt"`
	Modified     time.Time      `json:"updatedAt"`
	Permissions  int            `json:"permissions"`
	Settings     UserSettings   `json:"settings"`
}

type UserQuota

type UserQuota struct {
	MovieQuota MediaQuota `json:"movie"`
	TVQuota    MediaQuota `json:"tv"`
}

type UserSettings

type UserSettings struct {
	NotificationAgents int    `json:"notificationAgents"`
	ID                 int    `json:"id"`
	DiscordID          string `json:"discordId"`
	Region             string `json:"region"`
	Language           string `json:"originalLanguage"`
	PGPKey             string `json:"pgpKey"`
	TelegramChatID     int    `json:"telegramChatId"`
	TelegramSilent     bool   `json:"telegramSendSilently"`
}

type UserType

type UserType int
const (
	UserTypePlex  UserType = 1
	UserTypeLocal UserType = 2
)

func (UserType) ToString

func (t UserType) ToString() string

type UsersResponse

type UsersResponse struct {
	PageInfo Page    `json:"pageInfo"`
	Results  []*User `json:"results"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL