varasto: github.com/function61/varasto/pkg/themoviedbapi Index | Files

package themoviedbapi

import "github.com/function61/varasto/pkg/themoviedbapi"

themoviedb.org ("TMDb") REST API client

Index

Package Files

themoviedb.go

Constants

const (
    MediaTypeMovie = "movie"
    MediaTypeTv    = "tv"
)

func ImagePath Uses

func ImagePath(path string, width ImageSize) string

width=original|w500|...

type Client Uses

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

func New Uses

func New(apiKey string) *Client

func (*Client) GetEpisodeExternalIds Uses

func (c *Client) GetEpisodeExternalIds(
    ctx context.Context,
    tvId string,
    seasonNumber int,
    episodeNumber int,
) (*ExternalIds, error)

func (*Client) GetSeasonEpisodes Uses

func (c *Client) GetSeasonEpisodes(ctx context.Context, seasonNumber int, tvId string) ([]Episode, error)

doesn't support returning external IDs, but the "get one episode" does.

func (*Client) MultiSearch Uses

func (c *Client) MultiSearch(ctx context.Context, query string) ([]MultiSearchResult, error)

func (*Client) OpenMovie Uses

func (c *Client) OpenMovie(ctx context.Context, id string) (*Movie, error)

func (*Client) OpenMovieByImdbId Uses

func (c *Client) OpenMovieByImdbId(ctx context.Context, imdbId string) (*Movie, error)

func (*Client) OpenTv Uses

func (c *Client) OpenTv(ctx context.Context, id string) (*Tv, error)

func (*Client) OpenTvByImdbId Uses

func (c *Client) OpenTvByImdbId(ctx context.Context, imdbId string) (*Tv, error)

type Episode Uses

type Episode struct {
    Id            uint64 `json:"id"`
    SeasonNumber  int    `json:"season_number"`
    EpisodeNumber int    `json:"episode_number"`
    Name          string `json:"name"`
    Overview      string `json:"overview"`
    AirDate       string `json:"air_date"` // yyyy-mm-dd
    StillPath     string `json:"still_path"`
}

type ExternalIds Uses

type ExternalIds struct {
    Id     int64  `json:"id"`
    ImdbId string `json:"imdb_id"`
}

type ImageSize Uses

type ImageSize string
const (
    ImageSizeOriginal ImageSize = "original"
)

type Movie Uses

type Movie struct {
    Id             int64       `json:"id"`
    ExternalIds    ExternalIds `json:"external_ids"`
    Title          string      `json:"title"`
    OriginalTitle  string      `json:"original_title"`
    Overview       string      `json:"overview"`
    RuntimeMinutes int         `json:"runtime"`
    ReleaseDate    string      `json:"release_date"` // yyyy-mm-dd
    RevenueDollars int64       `json:"revenue"`
    BackdropPath   string      `json:"backdrop_path"`
}

type MultiSearchResult Uses

type MultiSearchResult struct {
    Id           int64  `json:"id"`
    MediaType    string `json:"media_type"`
    Title        string `json:"title"`          // when movie
    Name         string `json:"name"`           // when TV
    ReleaseDate  string `json:"release_date"`   // when movie, yyyy-mm-dd
    FirstAirDate string `json:"first_air_date"` // when TV, yyyy-mm-dd
}

type Tv Uses

type Tv struct {
    Id           int64       `json:"id"`
    Name         string      `json:"name"`
    Overview     string      `json:"overview"`
    BackdropPath string      `json:"backdrop_path"`
    PosterPath   string      `json:"poster_path"`
    Homepage     string      `json:"homepage"`
    ExternalIds  ExternalIds `json:"external_ids"`
}

Package themoviedbapi imports 5 packages (graph) and is imported by 2 packages. Updated 2020-09-18. Refresh now. Tools for package owners.