integrations

package
v1.2.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TMDBAPIBaseURL   = "https://api.themoviedb.org/3"
	TMDBImageBaseURL = "https://image.tmdb.org/t/p/w500"
)
View Source
const (
	TraktAPIBaseURL = "https://api.trakt.tv"
	TraktAPIVersion = "2"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AnticipatedMovie

type AnticipatedMovie struct {
	ListCount int   `json:"list_count"`
	Movie     Movie `json:"movie"`
}

AnticipatedMovie represents an anticipated movie from Trakt

type AnticipatedShow

type AnticipatedShow struct {
	ListCount int  `json:"list_count"`
	Show      Show `json:"show"`
}

AnticipatedShow represents an anticipated TV show from Trakt

type BoxOfficeMovie

type BoxOfficeMovie struct {
	Revenue int   `json:"revenue"`
	Movie   Movie `json:"movie"`
}

BoxOfficeMovie represents a box office movie from Trakt

type CollectedMovie

type CollectedMovie struct {
	WatcherCount   int   `json:"watcher_count"`
	PlayCount      int   `json:"play_count"`
	CollectedCount int   `json:"collected_count"`
	Movie          Movie `json:"movie"`
}

CollectedMovie represents a collected movie from Trakt

type CollectedShow

type CollectedShow struct {
	WatcherCount   int  `json:"watcher_count"`
	PlayCount      int  `json:"play_count"`
	CollectedCount int  `json:"collected_count"`
	CollectorCount int  `json:"collector_count"`
	Show           Show `json:"show"`
}

CollectedShow represents a collected TV show from Trakt

type Country added in v0.4.0

type Country struct {
	Name string `json:"name"`
	Code string `json:"code"`
}

Country represents a country from Trakt

type FavoritedMovie

type FavoritedMovie struct {
	UserCount int   `json:"user_count"`
	Movie     Movie `json:"movie"`
}

FavoritedMovie represents a favorited movie from Trakt

type FavoritedShow

type FavoritedShow struct {
	UserCount int  `json:"user_count"`
	Show      Show `json:"show"`
}

FavoritedShow represents a favorited TV show from Trakt

type Genre added in v0.4.0

type Genre struct {
	Name string `json:"name"`
	Slug string `json:"slug"`
}

Genre represents a genre from Trakt

type IDs

type IDs struct {
	Trakt int    `json:"trakt"`
	Slug  string `json:"slug"`
	IMDB  string `json:"imdb"`
	TMDB  int    `json:"tmdb"`
	TVDB  int    `json:"tvdb"`
}

IDs contains various IDs for a media item

type Jellyseerr added in v0.2.0

type Jellyseerr struct {
	// contains filtered or unexported fields
}

func NewJellyseerr added in v0.2.0

func NewJellyseerr(config JellyseerrConfig) *Jellyseerr

func (*Jellyseerr) GetMovieInfo added in v0.5.2

func (j *Jellyseerr) GetMovieInfo(tmdbID int) (*MediaInfo, error)

GetMovieInfo gets information about a movie from Jellyseerr

func (*Jellyseerr) GetShowInfo added in v0.5.2

func (j *Jellyseerr) GetShowInfo(tmdbID int) (*MediaInfo, error)

GetShowInfo gets information about a TV show from Jellyseerr

func (*Jellyseerr) GetStatus added in v0.2.0

func (j *Jellyseerr) GetStatus() (*StatusResponse, error)

GetStatus checks if Jellyseerr is accessible

func (*Jellyseerr) RequestMovie added in v0.2.0

func (j *Jellyseerr) RequestMovie(tmdbID int) (*RequestResponse, error)

RequestMovie requests a movie by TMDB ID

func (*Jellyseerr) RequestShow added in v0.2.0

func (j *Jellyseerr) RequestShow(tmdbID int) (*RequestResponse, error)

RequestShow requests a TV show by TMDB ID

type JellyseerrConfig added in v0.2.0

type JellyseerrConfig struct {
	URL    string
	APIKey string
	UserID string // Optional: request as specific user
	// Optional: Username/password for request authentication (respects user permissions)
	RequestEmail    string
	RequestPassword string
}

type Language added in v0.4.0

type Language struct {
	Name string `json:"name"`
	Code string `json:"code"`
}

Language represents a language from Trakt

type LoginRequest added in v0.5.2

type LoginRequest struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

LoginRequest represents the login payload

type LoginResponse added in v0.5.2

type LoginResponse struct {
	ID          int    `json:"id"`
	Email       string `json:"email"`
	DisplayName string `json:"displayName"`
}

LoginResponse represents the login response

type MediaInfo added in v0.5.2

type MediaInfo struct {
	MediaInfo struct {
		Status int `json:"status"`
	} `json:"mediaInfo"`
}

MediaInfo represents media information from Jellyseerr

func (*MediaInfo) HasMediaInfo added in v0.5.2

func (m *MediaInfo) HasMediaInfo() bool

HasMediaInfo checks if the media has an associated media info (requested/available)

type Movie

type Movie struct {
	Title    string   `json:"title"`
	Year     int      `json:"year"`
	IDs      IDs      `json:"ids"`
	Genres   []string `json:"genres"`
	Language string   `json:"language"`
	Country  string   `json:"country"`
	Runtime  int      `json:"runtime"` // in minutes
	Overview string   `json:"overview"`
	Rating   float64  `json:"rating"`
	Votes    int      `json:"votes"`
}

Movie represents a Trakt movie

type MovieRequest added in v0.2.0

type MovieRequest struct {
	MediaType string `json:"mediaType"`
	MediaID   int    `json:"mediaId"` // TMDB ID
	UserID    *int   `json:"userId,omitempty"`
}

MovieRequest represents a movie request payload

type Network added in v0.4.0

type Network struct {
	Name    string `json:"name"`
	Country string `json:"country"`
}

Network represents a TV network from Trakt

type PlayedMovie

type PlayedMovie struct {
	WatcherCount   int   `json:"watcher_count"`
	PlayCount      int   `json:"play_count"`
	CollectedCount int   `json:"collected_count"`
	Movie          Movie `json:"movie"`
}

PlayedMovie represents a played movie from Trakt

type PlayedShow

type PlayedShow struct {
	WatcherCount   int  `json:"watcher_count"`
	PlayCount      int  `json:"play_count"`
	CollectedCount int  `json:"collected_count"`
	CollectorCount int  `json:"collector_count"`
	Show           Show `json:"show"`
}

PlayedShow represents a played TV show from Trakt

type QualityProfile

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

QualityProfile represents a Radarr quality profile

type Radarr

type Radarr struct {
	// contains filtered or unexported fields
}

Radarr client for movie management

func NewRadarr

func NewRadarr(config RadarrConfig) *Radarr

NewRadarr creates a new Radarr API client

func (*Radarr) AddMovie

func (r *Radarr) AddMovie(ctx context.Context, movie RadarrMovie) (*RadarrMovie, error)

AddMovie adds a movie to Radarr

func (*Radarr) GetMovies

func (r *Radarr) GetMovies(ctx context.Context) ([]RadarrMovie, error)

GetMovies returns all movies in Radarr

func (*Radarr) GetQualityProfiles

func (r *Radarr) GetQualityProfiles(ctx context.Context) ([]QualityProfile, error)

GetQualityProfiles returns available quality profiles

func (*Radarr) GetRootFolders

func (r *Radarr) GetRootFolders(ctx context.Context) ([]RootFolder, error)

GetRootFolders returns available root folders

func (*Radarr) GetSystemStatus

func (r *Radarr) GetSystemStatus(ctx context.Context) (*SystemStatus, error)

GetSystemStatus returns Radarr system status

func (*Radarr) LookupMovie

func (r *Radarr) LookupMovie(ctx context.Context, term string) ([]RadarrMovie, error)

LookupMovie searches for a movie by TMDB ID or title

func (*Radarr) Validate

func (r *Radarr) Validate(ctx context.Context) error

Validate checks if the Radarr connection is valid

type RadarrAddOptions

type RadarrAddOptions struct {
	SearchForMovie bool `json:"searchForMovie"`
}

RadarrAddOptions specifies options when adding a movie

type RadarrConfig

type RadarrConfig struct {
	BaseURL string
	APIKey  string
}

RadarrConfig holds configuration for Radarr client

type RadarrMovie

type RadarrMovie struct {
	ID                  int               `json:"id,omitempty"`
	Title               string            `json:"title"`
	Year                int               `json:"year"`
	TmdbID              int               `json:"tmdbId"`
	ImdbID              string            `json:"imdbId,omitempty"`
	TitleSlug           string            `json:"titleSlug,omitempty"`
	Path                string            `json:"path,omitempty"`
	QualityProfileID    int               `json:"qualityProfileId"`
	Monitored           bool              `json:"monitored"`
	MinimumAvailability string            `json:"minimumAvailability"`
	RootFolderPath      string            `json:"rootFolderPath"`
	Tags                []int             `json:"tags,omitempty"`
	AddOptions          *RadarrAddOptions `json:"addOptions,omitempty"`
}

Movie represents a Radarr movie

type RequestResponse added in v0.2.0

type RequestResponse struct {
	ID         int    `json:"id"`
	Status     int    `json:"status"`
	MediaID    int    `json:"mediaId"`
	MediaType  string `json:"mediaType"`
	Message    string `json:"message,omitempty"`
	HTTPStatus int    `json:"-"` // HTTP status code (201 = new, 200 = existing)
}

RequestResponse represents the API response

func (*RequestResponse) IsAlreadyRequested added in v0.2.0

func (result *RequestResponse) IsAlreadyRequested() bool

IsAlreadyRequested checks if content was already requested (not newly created)

type RootFolder

type RootFolder struct {
	ID         int    `json:"id"`
	Path       string `json:"path"`
	FreeSpace  int64  `json:"freeSpace"`
	TotalSpace int64  `json:"totalSpace"`
	Accessible bool   `json:"accessible"`
}

RootFolder represents a Radarr root folder

type SearchResult

type SearchResult struct {
	Type  string  `json:"type"`
	Score float64 `json:"score"`
	Movie *Movie  `json:"movie,omitempty"`
	Show  *Show   `json:"show,omitempty"`
}

SearchResult represents a search result from Trakt

type Show

type Show struct {
	Title    string   `json:"title"`
	Year     int      `json:"year"`
	IDs      IDs      `json:"ids"`
	Genres   []string `json:"genres"`
	Language string   `json:"language"`
	Country  string   `json:"country"`
	Runtime  int      `json:"runtime"` // in minutes
	Network  string   `json:"network"`
	Overview string   `json:"overview"`
	Rating   float64  `json:"rating"`
	Votes    int      `json:"votes"`
}

Show represents a Trakt TV show

type ShowRequest added in v0.2.0

type ShowRequest struct {
	MediaType string `json:"mediaType"`
	MediaID   int    `json:"mediaId"` // TMDB ID (Jellyseerr uses TMDB for TV shows, not TVDB)
	Seasons   string `json:"seasons"` // "all" or specific seasons
	UserID    *int   `json:"userId,omitempty"`
}

ShowRequest represents a TV show request payload

type Sonarr

type Sonarr struct {
	// contains filtered or unexported fields
}

Sonarr client for TV show management

func NewSonarr

func NewSonarr(config SonarrConfig) *Sonarr

NewSonarr creates a new Sonarr API client

func (*Sonarr) AddSeries

func (s *Sonarr) AddSeries(ctx context.Context, series SonarrSeries) (*SonarrSeries, error)

AddSeries adds a TV series to Sonarr

func (*Sonarr) GetQualityProfiles

func (s *Sonarr) GetQualityProfiles(ctx context.Context) ([]SonarrQualityProfile, error)

GetQualityProfiles returns available quality profiles

func (*Sonarr) GetRootFolders

func (s *Sonarr) GetRootFolders(ctx context.Context) ([]SonarrRootFolder, error)

GetRootFolders returns available root folders

func (*Sonarr) GetSeries

func (s *Sonarr) GetSeries(ctx context.Context) ([]SonarrSeries, error)

GetSeries returns all series in Sonarr

func (*Sonarr) GetSystemStatus

func (s *Sonarr) GetSystemStatus(ctx context.Context) (*SonarrSystemStatus, error)

GetSystemStatus returns Sonarr system status

func (*Sonarr) LookupSeries

func (s *Sonarr) LookupSeries(ctx context.Context, term string) ([]SonarrSeries, error)

LookupSeries searches for a TV series by TVDB ID or title

func (*Sonarr) Validate

func (s *Sonarr) Validate(ctx context.Context) error

Validate checks if the Sonarr connection is valid

type SonarrAddOptions

type SonarrAddOptions struct {
	SearchForMissingEpisodes bool `json:"searchForMissingEpisodes"`
}

SonarrAddOptions specifies options when adding a series

type SonarrConfig

type SonarrConfig struct {
	BaseURL string
	APIKey  string
}

SonarrConfig holds configuration for Sonarr client

type SonarrQualityProfile

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

QualityProfile represents a Sonarr quality profile

type SonarrRootFolder

type SonarrRootFolder struct {
	ID         int    `json:"id"`
	Path       string `json:"path"`
	FreeSpace  int64  `json:"freeSpace"`
	TotalSpace int64  `json:"totalSpace"`
	Accessible bool   `json:"accessible"`
}

RootFolder represents a Sonarr root folder

type SonarrSeries

type SonarrSeries struct {
	ID                int               `json:"id,omitempty"`
	Title             string            `json:"title"`
	Year              int               `json:"year,omitempty"`
	TvdbID            int               `json:"tvdbId"`
	TmdbID            int               `json:"tmdbId,omitempty"`
	ImdbID            string            `json:"imdbId,omitempty"`
	TitleSlug         string            `json:"titleSlug,omitempty"`
	Path              string            `json:"path,omitempty"`
	QualityProfileID  int               `json:"qualityProfileId"`
	LanguageProfileID int               `json:"languageProfileId,omitempty"`
	Monitored         bool              `json:"monitored"`
	SeriesType        string            `json:"seriesType,omitempty"`
	SeasonFolder      bool              `json:"seasonFolder"`
	RootFolderPath    string            `json:"rootFolderPath"`
	Tags              []int             `json:"tags,omitempty"`
	AddOptions        *SonarrAddOptions `json:"addOptions,omitempty"`
}

Series represents a Sonarr TV series

type SonarrSystemStatus

type SonarrSystemStatus struct {
	Version string `json:"version"`
	AppName string `json:"appName"`
}

SystemStatus represents Sonarr system status

type StatusResponse added in v0.2.0

type StatusResponse struct {
	Version string `json:"version"`
	Status  string `json:"status"`
}

StatusResponse for checking Jellyseerr status

type SystemStatus

type SystemStatus struct {
	Version string `json:"version"`
	AppName string `json:"appName"`
}

SystemStatus represents Radarr system status

type TMDB added in v1.0.0

type TMDB struct {
	// contains filtered or unexported fields
}

TMDB is the client for interacting with TMDB API

func NewTMDB added in v1.0.0

func NewTMDB(config TMDBConfig) *TMDB

NewTMDB creates a new TMDB API client

func (*TMDB) GetMoviePosterURL added in v1.0.0

func (t *TMDB) GetMoviePosterURL(ctx context.Context, tmdbID int) (string, error)

GetMoviePosterURL fetches the poster URL for a movie by TMDB ID

func (*TMDB) GetShowPosterURL added in v1.0.0

func (t *TMDB) GetShowPosterURL(ctx context.Context, tmdbID int) (string, error)

GetShowPosterURL fetches the poster URL for a TV show by TMDB ID

type TMDBConfig added in v1.0.0

type TMDBConfig struct {
	APIKey string
}

TMDBConfig holds configuration for TMDB client

type TMDBMovie added in v1.0.0

type TMDBMovie struct {
	ID           int    `json:"id"`
	Title        string `json:"title"`
	PosterPath   string `json:"poster_path"`
	BackdropPath string `json:"backdrop_path"`
}

TMDBMovie represents a movie from TMDB

type TMDBShow added in v1.0.0

type TMDBShow struct {
	ID           int    `json:"id"`
	Name         string `json:"name"`
	PosterPath   string `json:"poster_path"`
	BackdropPath string `json:"backdrop_path"`
}

TMDBShow represents a TV show from TMDB

type Trakt

type Trakt struct {
	// contains filtered or unexported fields
}

Trakt is the client for interacting with Trakt API

func NewTrakt

func NewTrakt(config TraktConfig) *Trakt

NewTrakt creates a new Trakt API client

func (*Trakt) GetAnticipatedMovies

func (t *Trakt) GetAnticipatedMovies(ctx context.Context, limit int) ([]AnticipatedMovie, error)

GetAnticipatedMovies returns the most anticipated movies

func (*Trakt) GetAnticipatedShows

func (t *Trakt) GetAnticipatedShows(ctx context.Context, limit int) ([]AnticipatedShow, error)

GetAnticipatedShows returns the most anticipated TV shows

func (*Trakt) GetBoxOfficeMovies

func (t *Trakt) GetBoxOfficeMovies(ctx context.Context, limit int) ([]BoxOfficeMovie, error)

GetBoxOfficeMovies returns current box office movies

func (*Trakt) GetCollectedMovies

func (t *Trakt) GetCollectedMovies(ctx context.Context, period string, limit int) ([]CollectedMovie, error)

GetCollectedMovies returns the most collected movies

func (*Trakt) GetCollectedShows

func (t *Trakt) GetCollectedShows(ctx context.Context, period string, limit int) ([]CollectedShow, error)

GetCollectedShows returns the most collected TV shows

func (*Trakt) GetCountries added in v0.4.0

func (t *Trakt) GetCountries(ctx context.Context, mediaType string) ([]Country, error)

GetCountries returns available countries for movies or shows

func (*Trakt) GetFavoritedMovies

func (t *Trakt) GetFavoritedMovies(ctx context.Context, period string, limit int) ([]FavoritedMovie, error)

GetFavoritedMovies returns the most favorited movies

func (*Trakt) GetFavoritedShows

func (t *Trakt) GetFavoritedShows(ctx context.Context, period string, limit int) ([]FavoritedShow, error)

GetFavoritedShows returns the most favorited TV shows

func (*Trakt) GetGenres added in v0.4.0

func (t *Trakt) GetGenres(ctx context.Context, mediaType string) ([]Genre, error)

GetGenres returns available genres for movies or shows

func (*Trakt) GetLanguages added in v0.4.0

func (t *Trakt) GetLanguages(ctx context.Context, mediaType string) ([]Language, error)

GetLanguages returns available languages for movies or shows

func (*Trakt) GetNetworks added in v0.4.0

func (t *Trakt) GetNetworks(ctx context.Context) ([]Network, error)

GetNetworks returns available TV networks

func (*Trakt) GetPlayedMovies

func (t *Trakt) GetPlayedMovies(ctx context.Context, period string, limit int) ([]PlayedMovie, error)

GetPlayedMovies returns the most played movies

func (*Trakt) GetPlayedShows

func (t *Trakt) GetPlayedShows(ctx context.Context, period string, limit int) ([]PlayedShow, error)

GetPlayedShows returns the most played TV shows

func (*Trakt) GetPopularMovies

func (t *Trakt) GetPopularMovies(ctx context.Context, limit int) ([]Movie, error)

GetPopularMovies returns popular movies

func (*Trakt) GetPopularShows

func (t *Trakt) GetPopularShows(ctx context.Context, limit int) ([]Show, error)

GetPopularShows returns popular TV shows

func (*Trakt) GetTrendingMovies

func (t *Trakt) GetTrendingMovies(ctx context.Context, limit int) ([]TrendingMovie, error)

GetTrendingMovies returns trending movies

func (*Trakt) GetTrendingShows

func (t *Trakt) GetTrendingShows(ctx context.Context, limit int) ([]TrendingShow, error)

GetTrendingShows returns trending TV shows

func (*Trakt) GetWatchedMovies

func (t *Trakt) GetWatchedMovies(ctx context.Context, period string, limit int) ([]WatchedMovie, error)

GetWatchedMovies returns the most watched movies

func (*Trakt) GetWatchedShows

func (t *Trakt) GetWatchedShows(ctx context.Context, period string, limit int) ([]WatchedShow, error)

GetWatchedShows returns the most watched TV shows

func (*Trakt) Search

func (t *Trakt) Search(ctx context.Context, query string, searchType string, limit int) ([]SearchResult, error)

Search performs a search across Trakt content

func (*Trakt) Validate

func (t *Trakt) Validate(ctx context.Context) error

Validate checks if the Trakt client credentials are valid

type TraktConfig

type TraktConfig struct {
	ClientID     string
	ClientSecret string
}

TraktConfig holds configuration for Trakt client

type TrendingMovie

type TrendingMovie struct {
	Watchers int   `json:"watchers"`
	Movie    Movie `json:"movie"`
}

TrendingMovie represents a trending movie from Trakt

type TrendingShow

type TrendingShow struct {
	Watchers int  `json:"watchers"`
	Show     Show `json:"show"`
}

TrendingShow represents a trending TV show from Trakt

type WatchedMovie

type WatchedMovie struct {
	WatcherCount   int   `json:"watcher_count"`
	PlayCount      int   `json:"play_count"`
	CollectedCount int   `json:"collected_count"`
	Movie          Movie `json:"movie"`
}

WatchedMovie represents a watched movie from Trakt

type WatchedShow

type WatchedShow struct {
	WatcherCount   int  `json:"watcher_count"`
	PlayCount      int  `json:"play_count"`
	CollectedCount int  `json:"collected_count"`
	CollectorCount int  `json:"collector_count"`
	Show           Show `json:"show"`
}

WatchedShow represents a watched TV show from Trakt

Jump to

Keyboard shortcuts

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