mediadata

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShowMovieResults

func ShowMovieResults(movies MovieResults)

func ShowTvShowResults

func ShowTvShowResults(tvShows TvShowResults)

Types

type Episode

type Episode struct {
	ID            string  `json:"id"`
	AirDate       string  `json:"air_date"`
	EpisodeNumber int     `json:"episode_number"`
	SeasonNumber  int     `json:"season_number"`
	Name          string  `json:"name"`
	Overview      string  `json:"overview"`
	StillURL      string  `json:"still_url"`
	VoteAverage   float32 `json:"vote_average"`
	VoteCount     int64   `json:"vote_count"`
}

type Genre

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

type Movie

type Movie struct {
	ID          string  `json:"id"`
	Title       string  `json:"title"`
	Overview    string  `json:"overview"`
	ReleaseDate string  `json:"release_date"`
	Year        string  `json:"year"`
	PosterURL   string  `json:"poster_url"`
	Rating      float32 `json:"rating"`
	RatingCount int64   `json:"rating_count"`
}

type MovieClient

type MovieClient interface {
	SearchMovie(ctx context.Context, query string, year int, page int) (MovieResults, error)
	GetMovie(ctx context.Context, id string) (Movie, error)
	GetMovieDetails(ctx context.Context, id string) (MovieDetails, error)
}

type MovieDetails

type MovieDetails struct {
	Movie
	Runtime int      `json:"runtime"`
	Genres  []Genre  `json:"genres"`
	Cast    []Person `json:"cast"`
	Studio  []Studio `json:"studio"`
}

type MovieResults

type MovieResults struct {
	Movies         []Movie `json:"movies"`
	Totals         int64   `json:"totals"`
	ResultsPerPage int64   `json:"results_per_page"`
}

type Person

type Person struct {
	ID         string `json:"id"`
	Name       string `json:"name"`
	Character  string `json:"character"`
	ProfileURL string `json:"profile_url"`
}

type Season

type Season struct {
	SeasonNumber int    `json:"season_number"`
	EpisodeCount int    `json:"episode_count"`
	AirDate      string `json:"air_date"`
	PosterURL    string `json:"poster_url"`
}

type Status

type Status string
const (
	StatusReturning Status = "Returning Series"
	StatusEnded     Status = "Ended"
)

type Studio

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

type TvShow

type TvShow struct {
	ID          string  `json:"id"`
	Title       string  `json:"title"`
	Overview    string  `json:"overview"`
	FistAirDate string  `json:"first_air_date"`
	Year        string  `json:"year"`
	PosterURL   string  `json:"poster_url"`
	Rating      float32 `json:"rating"`
	RatingCount int64   `json:"rating_count"`
}

type TvShowClient

type TvShowClient interface {
	SearchTvShow(ctx context.Context, query string, year int, page int) (TvShowResults, error)
	GetTvShow(ctx context.Context, id string) (TvShow, error)
	GetTvShowDetails(ctx context.Context, id string) (TvShowDetails, error)
	GetEpisode(ctx context.Context, id string, seasonNumber int, episodeNumber int) (Episode, error)
}

type TvShowDetails

type TvShowDetails struct {
	TvShow
	SeasonCount  int      `json:"season_count"`
	EpisodeCount int      `json:"episode_count"`
	LastEpisode  Episode  `json:"last_episode"`
	NextEpisode  Episode  `json:"next_episode"`
	Status       Status   `json:"status"`
	Seasons      []Season `json:"seasons"`
	Genres       []Genre  `json:"genres"`
	Cast         []Person `json:"cast"`
	Studio       []Studio `json:"studio"`
}

type TvShowResults

type TvShowResults struct {
	TvShows        []TvShow `json:"tv_shows"`
	Totals         int64    `json:"totals"`
	ResultsPerPage int64    `json:"results_per_page"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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