Back to godoc.org

Package provider

v1.1.0
Latest Go to latest

The latest major version is .

Published: Aug 2, 2020 | License: GPL3 | Module: github.com/l3uddz/mediarr

Index

Constants

const (
	SearchTypeSchedule    string = "schedule"
	SearchTypeNow         string = "now_playing"
	SearchTypeUpcoming    string = "upcoming"
	SearchTypeAnticipated string = "anticipated"
	SearchTypePopular     string = "popular"
	SearchTypeTrending    string = "trending"
	SearchTypeWatched     string = "watched"
	SearchTypePlayed      string = "played"
	SearchTypeCollected   string = "collected"
	SearchTypePerson      string = "person"
	SearchTypeQuery       string = "query"
	SearchTypeList        string = "list"
)
const (
	TmdbRateLimit int = 3
)
const (
	TraktRateLimit int = 3
)

Const

const (
	TvMazeRateLimit int = 2
)

type Interface

type Interface interface {
	Init(MediaType, map[string]string) error
	SetIgnoreExistingMediaItemFn(func(*config.MediaItem) bool)
	SetAcceptMediaItemFn(func(*config.MediaItem) bool)

	GetShowsSearchTypes() []string
	GetMoviesSearchTypes() []string
	SupportsShowsSearchType(string) bool
	SupportsMoviesSearchType(string) bool

	GetShows(string, map[string]interface{}, map[string]string) (map[string]config.MediaItem, error)
	GetMovies(string, map[string]interface{}, map[string]string) (map[string]config.MediaItem, error)
}

func Get

func Get(providerType string) (Interface, error)

type MediaType

type MediaType int
const (
	Show MediaType = iota + 1
	Movie
)

type Tmdb

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

func NewTmdb

func NewTmdb() *Tmdb

func (*Tmdb) GetMovies

func (p *Tmdb) GetMovies(searchType string, logic map[string]interface{}, params map[string]string) (map[string]config.MediaItem, error)

func (*Tmdb) GetMoviesSearchTypes

func (p *Tmdb) GetMoviesSearchTypes() []string

func (*Tmdb) GetShows

func (p *Tmdb) GetShows(searchType string, logic map[string]interface{}, params map[string]string) (map[string]config.MediaItem, error)

func (*Tmdb) GetShowsSearchTypes

func (p *Tmdb) GetShowsSearchTypes() []string

func (*Tmdb) Init

func (p *Tmdb) Init(mediaType MediaType, cfg map[string]string) error

func (*Tmdb) SetAcceptMediaItemFn

func (p *Tmdb) SetAcceptMediaItemFn(fn func(*config.MediaItem) bool)

func (*Tmdb) SetIgnoreExistingMediaItemFn

func (p *Tmdb) SetIgnoreExistingMediaItemFn(fn func(*config.MediaItem) bool)

func (*Tmdb) SupportsMoviesSearchType

func (p *Tmdb) SupportsMoviesSearchType(searchType string) bool

func (*Tmdb) SupportsShowsSearchType

func (p *Tmdb) SupportsShowsSearchType(searchType string) bool

type TmdbGenre

type TmdbGenre struct {
	Id   int
	Name string
}

type TmdbGenreResponse

type TmdbGenreResponse struct {
	Genres []TmdbGenre
}

type TmdbMovieDetailsResponse

type TmdbMovieDetailsResponse struct {
	Adult               bool        `json:"adult"`
	BackdropPath        string      `json:"backdrop_path"`
	BelongsToCollection interface{} `json:"belongs_to_collection"`
	Budget              int         `json:"budget"`
	Genres              []struct {
		ID   int    `json:"id"`
		Name string `json:"name"`
	} `json:"genres"`
	Homepage            string        `json:"homepage"`
	ID                  int           `json:"id"`
	ImdbID              string        `json:"imdb_id"`
	OriginalLanguage    string        `json:"original_language"`
	OriginalTitle       string        `json:"original_title"`
	Overview            string        `json:"overview"`
	Popularity          float64       `json:"popularity"`
	PosterPath          string        `json:"poster_path"`
	ProductionCompanies []interface{} `json:"production_companies"`
	ProductionCountries []struct {
		Iso31661 string `json:"iso_3166_1"`
		Name     string `json:"name"`
	} `json:"production_countries"`
	ReleaseDate     string `json:"release_date"`
	Revenue         int    `json:"revenue"`
	Runtime         int    `json:"runtime"`
	SpokenLanguages []struct {
		Iso6391 string `json:"iso_639_1"`
		Name    string `json:"name"`
	} `json:"spoken_languages"`
	Status    string `json:"status"`
	Tagline   string `json:"tagline"`
	Title     string `json:"title"`
	Video     bool   `json:"video"`
	VoteCount int    `json:"vote_count"`
}

type TmdbMoviesResponse

type TmdbMoviesResponse struct {
	Results []struct {
		Popularity       float64 `json:"popularity"`
		VoteCount        int     `json:"vote_count"`
		Video            bool    `json:"video"`
		PosterPath       string  `json:"poster_path"`
		ID               int     `json:"id"`
		Adult            bool    `json:"adult"`
		BackdropPath     string  `json:"backdrop_path"`
		OriginalLanguage string  `json:"original_language"`
		OriginalTitle    string  `json:"original_title"`
		GenreIds         []int   `json:"genre_ids"`
		Title            string  `json:"title"`
		Overview         string  `json:"overview"`
		ReleaseDate      string  `json:"release_date"`
	} `json:"results"`
	Page         int `json:"page"`
	TotalResults int `json:"total_results"`
	Dates        struct {
		Maximum string `json:"maximum"`
		Minimum string `json:"minimum"`
	} `json:"dates"`
	TotalPages int `json:"total_pages"`
}

type Trakt

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

func NewTrakt

func NewTrakt() *Trakt

func (*Trakt) GetMovies

func (p *Trakt) GetMovies(searchType string, logic map[string]interface{}, params map[string]string) (map[string]config.MediaItem, error)

func (*Trakt) GetMoviesSearchTypes

func (p *Trakt) GetMoviesSearchTypes() []string

func (*Trakt) GetShows

func (p *Trakt) GetShows(searchType string, logic map[string]interface{}, params map[string]string) (map[string]config.MediaItem, error)

func (*Trakt) GetShowsSearchTypes

func (p *Trakt) GetShowsSearchTypes() []string

func (*Trakt) Init

func (p *Trakt) Init(mediaType MediaType, cfg map[string]string) error

func (*Trakt) SetAcceptMediaItemFn

func (p *Trakt) SetAcceptMediaItemFn(fn func(*config.MediaItem) bool)

func (*Trakt) SetIgnoreExistingMediaItemFn

func (p *Trakt) SetIgnoreExistingMediaItemFn(fn func(*config.MediaItem) bool)

func (*Trakt) SupportsMoviesSearchType

func (p *Trakt) SupportsMoviesSearchType(searchType string) bool

func (*Trakt) SupportsShowsSearchType

func (p *Trakt) SupportsShowsSearchType(searchType string) bool

type TraktMovie

type TraktMovie struct {
	Type                  string        `json:"type"`
	Title                 string        `json:"title"`
	Year                  int           `json:"year"`
	Ids                   TraktMovieIds `json:"ids"`
	Tagline               string        `json:"tagline"`
	Overview              string        `json:"overview"`
	Released              string        `json:"released"`
	Runtime               int           `json:"runtime"`
	Country               string        `json:"country"`
	Trailer               string        `json:"trailer"`
	Homepage              string        `json:"homepage"`
	Status                string        `json:"status"`
	Rating                float64       `json:"rating"`
	Votes                 int           `json:"votes"`
	CommentCount          int           `json:"comment_count"`
	Language              string        `json:"language"`
	AvailableTranslations []string      `json:"available_translations"`
	Genres                []string      `json:"genres"`
	Certification         string        `json:"certification"`
	Character             string        `json:"character"`
}

type TraktMovieIds

type TraktMovieIds struct {
	Trakt int    `json:"trakt"`
	Slug  string `json:"slug"`
	Imdb  string `json:"imdb"`
	Tmdb  int    `json:"tmdb"`
}

type TraktMoviesResponse

type TraktMoviesResponse struct {
	TraktMovie
	Character *string     `json:"character"`
	Type      *string     `json:"type"`
	Movie     *TraktMovie `json:"movie"`
}

type TraktPersonMovieCastResponse

type TraktPersonMovieCastResponse struct {
	Cast []TraktMoviesResponse
}

type TraktPersonShowCastResponse

type TraktPersonShowCastResponse struct {
	Cast []TraktShowsResponse
}

type TraktShow

type TraktShow struct {
	Type                  string       `json:"type"`
	Title                 string       `json:"title"`
	Year                  int          `json:"year"`
	Ids                   TraktShowIds `json:"ids"`
	Overview              string       `json:"overview"`
	FirstAired            time.Time    `json:"first_aired"`
	Runtime               int          `json:"runtime"`
	Certification         string       `json:"certification"`
	Network               string       `json:"network"`
	Country               string       `json:"country"`
	Trailer               string       `json:"trailer"`
	Homepage              string       `json:"homepage"`
	Status                string       `json:"status"`
	Rating                float64      `json:"rating"`
	Votes                 int          `json:"votes"`
	CommentCount          int          `json:"comment_count"`
	Language              string       `json:"language"`
	AvailableTranslations []string     `json:"available_translations"`
	Genres                []string     `json:"genres"`
	AiredEpisodes         int          `json:"aired_episodes"`
	Character             string       `json:"character"`
}

type TraktShowIds

type TraktShowIds struct {
	Trakt int    `json:"trakt"`
	Slug  string `json:"slug"`
	Tvdb  int    `json:"tvdb"`
	Imdb  string `json:"imdb"`
	Tmdb  int    `json:"tmdb"`
}

type TraktShowsResponse

type TraktShowsResponse struct {
	TraktShow
	Character *string    `json:"character"`
	Type      *string    `json:"type"`
	Show      *TraktShow `json:"show"`
}

type TvMaze

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

func NewTvMaze

func NewTvMaze() *TvMaze

func (*TvMaze) GetMovies

func (p *TvMaze) GetMovies(searchType string, logic map[string]interface{}, params map[string]string) (map[string]config.MediaItem, error)

func (*TvMaze) GetMoviesSearchTypes

func (p *TvMaze) GetMoviesSearchTypes() []string

func (*TvMaze) GetShows

func (p *TvMaze) GetShows(searchType string, logic map[string]interface{}, params map[string]string) (map[string]config.MediaItem, error)

func (*TvMaze) GetShowsSearchTypes

func (p *TvMaze) GetShowsSearchTypes() []string

func (*TvMaze) Init

func (p *TvMaze) Init(mediaType MediaType, cfg map[string]string) error

func (*TvMaze) SetAcceptMediaItemFn

func (p *TvMaze) SetAcceptMediaItemFn(fn func(*config.MediaItem) bool)

func (*TvMaze) SetIgnoreExistingMediaItemFn

func (p *TvMaze) SetIgnoreExistingMediaItemFn(fn func(*config.MediaItem) bool)

func (*TvMaze) SupportsMoviesSearchType

func (p *TvMaze) SupportsMoviesSearchType(searchType string) bool

func (*TvMaze) SupportsShowsSearchType

func (p *TvMaze) SupportsShowsSearchType(searchType string) bool

type TvMazeScheduleItem

type TvMazeScheduleItem struct {
	ID       int         `json:"id"`
	URL      string      `json:"url"`
	Name     string      `json:"name"`
	Season   int         `json:"season"`
	Number   int         `json:"number"`
	Airdate  string      `json:"airdate"`
	Airtime  string      `json:"airtime"`
	Airstamp time.Time   `json:"airstamp"`
	Runtime  int         `json:"runtime"`
	Image    interface{} `json:"image"`
	Summary  string      `json:"summary"`
	Embedded struct {
		Show struct {
			ID           int      `json:"id"`
			URL          string   `json:"url"`
			Name         string   `json:"name"`
			Type         string   `json:"type"`
			Language     string   `json:"language"`
			Genres       []string `json:"genres"`
			Status       string   `json:"status"`
			Runtime      int      `json:"runtime"`
			Premiered    string   `json:"premiered"`
			OfficialSite string   `json:"officialSite"`
			Schedule     struct {
				Time string   `json:"time"`
				Days []string `json:"days"`
			} `json:"schedule"`
			Rating struct {
				Average interface{} `json:"average"`
			} `json:"rating"`
			Weight  int `json:"weight"`
			Network struct {
				ID      int    `json:"id"`
				Name    string `json:"name"`
				Country struct {
					Name     string `json:"name"`
					Code     string `json:"code"`
					Timezone string `json:"timezone"`
				} `json:"country"`
			} `json:"network"`
			WebChannel interface{} `json:"webChannel"`
			Externals  struct {
				Tvrage  interface{} `json:"tvrage"`
				Thetvdb int         `json:"thetvdb"`
				Imdb    string      `json:"imdb"`
			} `json:"externals"`
			Image struct {
				Medium   string `json:"medium"`
				Original string `json:"original"`
			} `json:"image"`
			Summary string `json:"summary"`
			Updated int    `json:"updated"`
			Links   struct {
				Self struct {
					Href string `json:"href"`
				} `json:"self"`
				Previousepisode struct {
					Href string `json:"href"`
				} `json:"previousepisode"`
				Nextepisode struct {
					Href string `json:"href"`
				} `json:"nextepisode"`
			} `json:"_links"`
		} `json:"show"`
	} `json:"_embedded"`
}

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier