elements

package
v0.0.0-...-2e150c0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2023 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Film

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

methods for merging and validating metadata. handles FilmMeta, not FilmMetaExtra

func (*Film) Identified

func (f *Film) Identified() bool

check if film identified

func (*Film) MergeMetadata

func (f *Film) MergeMetadata(m FilmMeta)

merge new metadata

func (*Film) Metadata

func (f *Film) Metadata() FilmMeta

get film metadata

type FilmInfo

type FilmInfo struct {
	Imdbid string `json:"imdbid" schema:"imdbid"`
	Tmdbid int    `json:"tmdbid" schema:"tmdbid"`
	Title  string `json:"title" schema:"title"`
	Year   int    `json:"year" schema:"year"`
}

basic film info

type FilmMeta

type FilmMeta struct {
	FilmInfo
	Ratings   Ratings  `json:"ratings"`
	Languages []string `json:"languages"`
	Countries []string `json:"countries"`
}

metadata of film, including FilmInfo

func (*FilmMeta) MarshalJSON

func (m *FilmMeta) MarshalJSON() ([]byte, error)

type FilmMetaExtra

type FilmMetaExtra struct {
	FilmMeta
	Poster string `json:"poster"`
}

FilmMeta plus poster field. needed because kodi 'getMovies' rpc query doesn't include poster. used only for metadata service and its client/cache

type Rating

type Rating struct {
	Rating float64 `json:"rating"`
	Votes  int     `json:"votes"`
}

type Ratings

type Ratings struct {
	Rottentomatoes Rating `json:"rottentomatoes"`
	Imdb           Rating `json:"imdb"`
	Metacritic     Rating `json:"metacritic"`
}

type Subtitle

type Subtitle interface {
	// check if subtitle data exists
	Exists() bool
	// get subtitle format
	Format() SubtitleFormat
	// get subtitle data
	Data() io.Reader
	// set subtitle data
	SetData(f SubtitleFormat) io.Writer
	// remove advertisements from subtitle
	Clean() error
}

subtitle data object

func NewSubtitle

func NewSubtitle() Subtitle

subtitle factory

type SubtitleFormat

type SubtitleFormat string

supported subtitle formats

const (
	// represents no actual subtitle data
	SubFmtNone SubtitleFormat = ""
	SubFmtSrt  SubtitleFormat = ".srt"
	SubFmtVtt  SubtitleFormat = ".vtt"
	SubFmtSsa  SubtitleFormat = ".ssa"
	SubFmtTtml SubtitleFormat = ".ttml"
)

type SubtitleInfo

type SubtitleInfo struct {
	FilmInfo
	Language string `schema:"language"`
	OsHash   string `schema:"os_hash"`
}

basic subtitle info

Jump to

Keyboard shortcuts

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