tmdb

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package tmdb implements metadata.Provider against The Movie Database's v3 REST API.

Index

Constants

View Source
const (
	// DefaultBaseURL is TMDB's v3 API root.
	DefaultBaseURL = "https://api.themoviedb.org/3"

	// DefaultPosterBaseURL is TMDB's image CDN at the w500 size. TMDB
	// returns poster paths ("/abc.jpg"), never absolute URLs, so a size
	// prefix has to be chosen client-side; w500 is the size TMDB's own
	// documentation uses for list art.
	DefaultPosterBaseURL = "https://image.tmdb.org/t/p/w500"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a TMDB v3 API client.

func New

func New(cfg Config) (*Client, error)

New creates a TMDB client. It performs no network call: the only way it fails is an empty API key.

func (*Client) LookupShow

func (c *Client) LookupShow(ctx context.Context, title string, year int) (*metadata.ShowMetadata, error)

LookupShow resolves a show against TMDB in two requests: GET /search/tv to find it, then GET /tv/{id} for the genres, certification and cross-references a search hit does not carry.

func (*Client) Name

func (c *Client) Name() string

Name returns "tmdb".

type Config

type Config struct {
	// APIKey is the TMDB v3 API key. The caller supplies it -- this
	// package never reads the environment.
	APIKey string

	// BaseURL overrides DefaultBaseURL. Tests point it at an httptest
	// server.
	BaseURL string

	// PosterBaseURL overrides DefaultPosterBaseURL, to pick a different
	// image size or a mirror.
	PosterBaseURL string

	// Language is the tag TMDB answers in (an ISO 639-1 code, optionally
	// with a region: "en-US", "fr-FR"). Defaults to defaultLanguage.
	Language string
}

Config configures a TMDB client.

Jump to

Keyboard shortcuts

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