music

package
v0.0.0-...-abf6750 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Playlist

type Playlist struct {
	Title, Author, URL string
	Duration           time.Duration
}

type Provider

type Provider interface {
	DisplayName() string
	IsSupported(term string, query bool) bool
	Find(term string) (*QueryResult, error)
	IsLoaded(*Song) bool
	Load(*Song) error
}

func FindByInput

func FindByInput(term string, querySupport bool) Provider

type QueryResult

type QueryResult struct {
	Songs    []*Song
	Playlist *Playlist
}

func FindSong

func FindSong(term string, querySupport bool) (*QueryResult, error)

type Song

type Song struct {
	Title     string `json:"title"`
	Author    string `json:"author"`
	Thumbnail string `json:"thumbnail"`
	URL       string `json:"url"`
	MediaURL  string `json:"-"`

	Duration time.Duration `json:"duration"`
	IsLive   bool          `json:"isLive"`
	IsOpus   bool          `json:"-"`
	Expires  time.Time     `json:"-"`
	// contains filtered or unexported fields
}

func (*Song) IsLoaded

func (s *Song) IsLoaded() bool

func (*Song) Load

func (s *Song) Load() error

func (*Song) Provider

func (s *Song) Provider() string

type YoutubeProvider

type YoutubeProvider struct{}

func (YoutubeProvider) DisplayName

func (YoutubeProvider) DisplayName() string

func (YoutubeProvider) Find

func (provider YoutubeProvider) Find(term string) (*QueryResult, error)

func (YoutubeProvider) IsLoaded

func (YoutubeProvider) IsLoaded(s *Song) bool

func (YoutubeProvider) IsSupported

func (YoutubeProvider) IsSupported(term string, query bool) bool

func (YoutubeProvider) Load

func (provider YoutubeProvider) Load(s *Song) error

Jump to

Keyboard shortcuts

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