pkg

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestYoutubeURL

func TestYoutubeURL(url string) bool

Types

type LoadMaster

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

func NewLoadMaster

func NewLoadMaster(ctx context.Context, clearTime time.Duration) *LoadMaster

func (*LoadMaster) Add

func (m *LoadMaster) Add(path string)

func (*LoadMaster) DeleteAll

func (m *LoadMaster) DeleteAll()

func (*LoadMaster) Remove

func (m *LoadMaster) Remove(path string)

type PlayerStatus

type PlayerStatus struct {
	Loop  bool         `json:"loop"`
	Radio bool         `json:"radio"`
	Song  SessionStats `json:"song"`
	Now   *Song        `json:"now,omitempty"`
}

type ServiceName

type ServiceName string
const (
	ServiceYouTube ServiceName = "youtube"
)

type SessionStats

type SessionStats struct {
	Pos      float64 `json:"position"` // seconds
	Duration float64 `json:"duration"` // seconds
}

type Song

type Song struct {
	Title        string      `firestore:"title,omitempty" csv:"title" json:"title,omitempty"`
	URL          string      `firestore:"url,omitempty" csv:"url,omitempty" json:"url,omitempty"`
	Service      ServiceName `firestore:"service,omitempty" csv:"service,omitempty" json:"service,omitempty"`
	ArtistName   string      `firestore:"artist_name,omitempty" csv:"artist_name,omitempty" json:"artist_name,omitempty"`
	ArtistURL    string      `firestore:"artist_url,omitempty" csv:"artist_url,omitempty" json:"artist_url,omitempty"`
	ArtworkURL   string      `firestore:"artwork_url,omitempty" csv:"artwork_url,omitempty" json:"artwork_url,omitempty"`
	ThumbnailURL string      `firestore:"thumbnail_url,omitempty" csv:"thumbnail_url,omitempty" json:"thumbnail_url,omitempty"`
	Playbacks    int         `firestore:"playbacks,omitempty" csv:"playbacks" json:"playbacks,omitempty"`
	LastPlay     time.Time   `firestore:"last_play,omitempty" csv:"last_play,omitempty" json:"last_play,omitempty"`

	ID        SongID          `firestore:"-" csv:"-" json:"-"`
	Requester *discordgo.User `firestore:"-" csv:"-" json:"-"`
	StreamURL string          `firestore:"-" csv:"-" json:"-"`
	Duration  float64         `firestore:"-" csv:"-" json:"-"`
}

func (*Song) MergeNoOverride

func (s *Song) MergeNoOverride(new *Song)

type SongID

type SongID struct {
	ID      string
	Service ServiceName
}

func GetIDFromURL

func GetIDFromURL(url string) SongID

func (SongID) String

func (id SongID) String() string

type User

type User struct {
	Name  string          `firestore:"username,omitempty" csv:"name,omitempty" json:"name,omitempty"`
	Songs map[string]Song `firestore:"songs,omitempty" csv:"songs" json:"songs,omitempty"`
}

Jump to

Keyboard shortcuts

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