integrations

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

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 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 IDs

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

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) 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(tvdbID int) (*RequestResponse, error)

RequestShow requests a TV show by TVDB ID

type JellyseerrConfig added in v0.2.0

type JellyseerrConfig struct {
	URL    string
	APIKey string
	UserID string // Optional: request as specific user
}

type Movie

type Movie struct {
	Title string `json:"title"`
	Year  int    `json:"year"`
	IDs   IDs    `json:"ids"`
}

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    string `json:"userId,omitempty"`
}

MovieRequest represents a movie request payload

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"`
}

RequestResponse represents the API response

func (*RequestResponse) IsAlreadyRequested added in v0.2.0

func (result *RequestResponse) IsAlreadyRequested() bool

IsAlreadyRequested checks if content is already requested or available

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"`
}

Show represents a Trakt TV show

type ShowRequest added in v0.2.0

type ShowRequest struct {
	MediaType string `json:"mediaType"`
	MediaID   int    `json:"mediaId"` // TVDB ID
	Seasons   string `json:"seasons"` // "all" or specific seasons
	UserID    string `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 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) 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) 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