sources

package
v0.1.0-nightly Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitManager

func InitManager()

func SupportsMediaType

func SupportsMediaType(s Source, mediaType string) bool

Types

type LocalFileSource

type LocalFileSource struct {
	Path string
}

func InitLocalFileSource

func InitLocalFileSource(filepath string) (*LocalFileSource, error)

func (*LocalFileSource) CompleteMetadata

func (s *LocalFileSource) CompleteMetadata(playable types.SourcePlayable) (types.SourcePlayable, error)

func (*LocalFileSource) GetContent

func (s *LocalFileSource) GetContent(playable types.SourcePlayable) ([]byte, error)

func (*LocalFileSource) GetID

func (s *LocalFileSource) GetID() string

func (*LocalFileSource) GetLyrics

func (s *LocalFileSource) GetLyrics(playable types.LyricsPlayable) (map[string]string, error)

func (*LocalFileSource) GetMediaTypes

func (*LocalFileSource) GetMediaTypes() []string

func (*LocalFileSource) GetName

func (s *LocalFileSource) GetName() string

func (*LocalFileSource) GetSourceTypes

func (*LocalFileSource) GetSourceTypes() []string

func (*LocalFileSource) GetVersion

func (*LocalFileSource) GetVersion() types.Version

func (*LocalFileSource) Search

func (s *LocalFileSource) Search(_ string, _ int, _ int, filters map[string]interface{}) ([]types.SourcePlayable, error)

type Manager

type Manager struct {
	// contains filtered or unexported fields
}
var SM Manager

func (*Manager) EnableSource

func (sm *Manager) EnableSource(sourceStr string) error

func (*Manager) EnableSources

func (sm *Manager) EnableSources()

func (*Manager) IsHigherPriority

func (*Manager) IsHigherPriority(first string, second string) bool

type Source

type Source interface {
	GetID() string
	GetName() string
	GetVersion() types.Version
	GetSourceTypes() []string
	GetMediaTypes() []string
	Search(query string, limit int, page int, filters map[string]interface{}) ([]types.SourcePlayable, error)
	GetContent(playable types.SourcePlayable) ([]byte, error)
	GetLyrics(playable types.LyricsPlayable) (map[string]string, error)
	CompleteMetadata(playable types.SourcePlayable) (types.SourcePlayable, error)
}

type SpotifySource

type SpotifySource struct {
}

func InitSpotifySource

func InitSpotifySource() (*SpotifySource, error)

func (*SpotifySource) CompleteMetadata

func (s *SpotifySource) CompleteMetadata(playable types.SourcePlayable) (types.SourcePlayable, error)

func (*SpotifySource) GetContent

func (*SpotifySource) GetContent(_ types.SourcePlayable) ([]byte, error)

func (*SpotifySource) GetID

func (*SpotifySource) GetID() string

func (*SpotifySource) GetLyrics

func (s *SpotifySource) GetLyrics(playable types.LyricsPlayable) (map[string]string, error)

func (*SpotifySource) GetMediaTypes

func (*SpotifySource) GetMediaTypes() []string

func (*SpotifySource) GetName

func (*SpotifySource) GetName() string

func (*SpotifySource) GetSourceTypes

func (*SpotifySource) GetSourceTypes() []string

func (*SpotifySource) GetVersion

func (*SpotifySource) GetVersion() types.Version

func (*SpotifySource) Search

func (*SpotifySource) Search(_ string, _ int, _ int, _ map[string]interface{}) ([]types.SourcePlayable, error)

type WebSource

type WebSource struct {
	URL string
}

func InitWebSource

func InitWebSource(url string) (*WebSource, error)

func (*WebSource) CompleteMetadata

func (s *WebSource) CompleteMetadata(playable types.SourcePlayable) (types.SourcePlayable, error)

func (*WebSource) GetContent

func (s *WebSource) GetContent(playable types.SourcePlayable) ([]byte, error)

func (*WebSource) GetID

func (*WebSource) GetID() string

func (*WebSource) GetLyrics

func (s *WebSource) GetLyrics(playable types.LyricsPlayable) (map[string]string, error)

func (*WebSource) GetMediaTypes

func (*WebSource) GetMediaTypes() []string

func (*WebSource) GetName

func (*WebSource) GetName() string

func (*WebSource) GetSourceTypes

func (*WebSource) GetSourceTypes() []string

func (*WebSource) GetVersion

func (*WebSource) GetVersion() types.Version

func (*WebSource) Search

func (*WebSource) Search(_ string, _ int, _ int, _ map[string]interface{}) ([]types.SourcePlayable, error)

type YouTubeSource

type YouTubeSource struct {
}

func InitYouTubeSource

func InitYouTubeSource() (*YouTubeSource, error)

func (*YouTubeSource) CompleteMetadata

func (s *YouTubeSource) CompleteMetadata(playable types.SourcePlayable) (types.SourcePlayable, error)

func (*YouTubeSource) GetContent

func (s *YouTubeSource) GetContent(playable types.SourcePlayable) ([]byte, error)

func (*YouTubeSource) GetID

func (*YouTubeSource) GetID() string

func (*YouTubeSource) GetLyrics

func (s *YouTubeSource) GetLyrics(playable types.LyricsPlayable) (map[string]string, error)

func (*YouTubeSource) GetMediaTypes

func (*YouTubeSource) GetMediaTypes() []string

func (*YouTubeSource) GetName

func (*YouTubeSource) GetName() string

func (*YouTubeSource) GetSourceTypes

func (*YouTubeSource) GetSourceTypes() []string

func (*YouTubeSource) GetVersion

func (*YouTubeSource) GetVersion() types.Version

func (*YouTubeSource) Search

func (s *YouTubeSource) Search(query string, limit int, _ int, filters map[string]interface{}) ([]types.SourcePlayable, error)

Jump to

Keyboard shortcuts

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