engine

package
v0.0.0-...-478ad6c Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2025 License: Apache-2.0 Imports: 65 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultEngineName     = "metatube"
	DefaultRequestTimeout = time.Minute
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

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

func Default

func Default() *Engine

func New

func New(db *gorm.DB, opts ...Option) *Engine

func (*Engine) DBAutoMigrate

func (e *Engine) DBAutoMigrate(v bool) error

func (*Engine) DBDriver

func (e *Engine) DBDriver() string

func (*Engine) DBVersion

func (e *Engine) DBVersion() (version string, err error)

func (*Engine) Fetch

func (e *Engine) Fetch(url string, provider mt.Provider) (*http.Response, error)

Fetch fetches content from url. If the provider is nil, the default fetcher will be used.

func (*Engine) GetActorInfoByProviderID

func (e *Engine) GetActorInfoByProviderID(pid providerid.ProviderID, lazy bool) (*model.ActorInfo, error)

func (*Engine) GetActorInfoByURL

func (e *Engine) GetActorInfoByURL(rawURL string, lazy bool) (*model.ActorInfo, error)

func (*Engine) GetActorPrimaryImage

func (e *Engine) GetActorPrimaryImage(pid providerid.ProviderID) (image.Image, error)

func (*Engine) GetActorProviderByName

func (e *Engine) GetActorProviderByName(name string) (mt.ActorProvider, error)

func (*Engine) GetActorProviderByURL

func (e *Engine) GetActorProviderByURL(rawURL string) (mt.ActorProvider, error)

func (*Engine) GetActorProviders

func (e *Engine) GetActorProviders() map[string]mt.ActorProvider

func (*Engine) GetImageByURL

func (e *Engine) GetImageByURL(provider mt.Provider, url string, ratio, pos float64, auto bool) (img image.Image, err error)

func (*Engine) GetMovieBackdropImage

func (e *Engine) GetMovieBackdropImage(pid providerid.ProviderID) (image.Image, error)

func (*Engine) GetMovieInfoByProviderID

func (e *Engine) GetMovieInfoByProviderID(pid providerid.ProviderID, lazy bool) (*model.MovieInfo, error)

func (*Engine) GetMovieInfoByURL

func (e *Engine) GetMovieInfoByURL(rawURL string, lazy bool) (*model.MovieInfo, error)

func (*Engine) GetMoviePrimaryImage

func (e *Engine) GetMoviePrimaryImage(pid providerid.ProviderID, ratio, pos float64) (image.Image, error)

func (*Engine) GetMovieProviderByName

func (e *Engine) GetMovieProviderByName(name string) (mt.MovieProvider, error)

func (*Engine) GetMovieProviderByURL

func (e *Engine) GetMovieProviderByURL(rawURL string) (mt.MovieProvider, error)

func (*Engine) GetMovieProviders

func (e *Engine) GetMovieProviders() map[string]mt.MovieProvider

func (*Engine) GetMovieReviewsByProviderID

func (e *Engine) GetMovieReviewsByProviderID(pid providerid.ProviderID, lazy bool) (*model.MovieReviewInfo, error)

func (*Engine) GetMovieReviewsByProviderURL

func (e *Engine) GetMovieReviewsByProviderURL(rawURL string, lazy bool) (*model.MovieReviewInfo, error)

func (*Engine) GetMovieThumbImage

func (e *Engine) GetMovieThumbImage(pid providerid.ProviderID) (image.Image, error)

func (*Engine) IsActorProvider

func (e *Engine) IsActorProvider(name string) bool

func (*Engine) IsMovieProvider

func (e *Engine) IsMovieProvider(name string) bool

func (*Engine) MustGetActorProviderByName

func (e *Engine) MustGetActorProviderByName(name string) mt.ActorProvider

func (*Engine) MustGetMovieProviderByName

func (e *Engine) MustGetMovieProviderByName(name string) mt.MovieProvider

func (*Engine) SearchActor

func (e *Engine) SearchActor(keyword, name string, fallback bool) ([]*model.ActorSearchResult, error)

func (*Engine) SearchActorAll

func (e *Engine) SearchActorAll(keyword string, fallback bool) (results []*model.ActorSearchResult, err error)

func (*Engine) SearchMovie

func (e *Engine) SearchMovie(keyword, name string, fallback bool) ([]*model.MovieSearchResult, error)

func (*Engine) SearchMovieAll

func (e *Engine) SearchMovieAll(keyword string, fallback bool) (results []*model.MovieSearchResult, err error)

SearchMovieAll searches the keyword from all providers.

func (*Engine) String

func (e *Engine) String() string

String returns the name of the Engine instance.

type Option

type Option func(*Engine)

func WithActorProviderConfig

func WithActorProviderConfig(name string, config mt.Config) Option

func WithEngineName

func WithEngineName(name string) Option

func WithMovieProviderConfig

func WithMovieProviderConfig(name string, config mt.Config) Option

func WithRequestTimeout

func WithRequestTimeout(timeout time.Duration) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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