core

package
v0.39.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2020 License: GPL-3.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const NowPlayingExpire = 60 * time.Minute
View Source
const UnavailableArtistID = "-1"

Variables

Functions

func GetEntityByID added in v0.36.0

func GetEntityByID(ctx context.Context, ds model.DataStore, id string) (interface{}, error)

TODO: Should the type be encoded in the ID?

func LastFMNewClient added in v0.36.0

func LastFMNewClient() *lastfm.Client

func SpotifyNewClient added in v0.36.0

func SpotifyNewClient() *spotify.Client

Types

type Archiver added in v0.29.0

type Archiver interface {
	ZipAlbum(ctx context.Context, id string, w io.Writer) error
	ZipArtist(ctx context.Context, id string, w io.Writer) error
	ZipPlaylist(ctx context.Context, id string, w io.Writer) error
}

func NewArchiver added in v0.29.0

func NewArchiver(ds model.DataStore) Archiver

type Artwork added in v0.28.0

type Artwork interface {
	Get(ctx context.Context, id string, size int, out io.Writer) error
}

func NewArtwork added in v0.28.0

func NewArtwork(ds model.DataStore, cache ArtworkCache) Artwork

type ArtworkCache added in v0.28.0

type ArtworkCache cache.FileCache

func GetImageCache added in v0.37.0

func GetImageCache() ArtworkCache

type CacheWarmer added in v0.37.0

type CacheWarmer interface {
	AddAlbum(ctx context.Context, albumID string)
	Flush(ctx context.Context)
}

func NewCacheWarmer added in v0.37.0

func NewCacheWarmer(artwork Artwork, artworkCache ArtworkCache) CacheWarmer

type ExternalInfo added in v0.36.0

type ExternalInfo interface {
	UpdateArtistInfo(ctx context.Context, id string, count int, includeNotPresent bool) (*model.Artist, error)
	SimilarSongs(ctx context.Context, id string, count int) (model.MediaFiles, error)
	TopSongs(ctx context.Context, artist string, count int) (model.MediaFiles, error)
}

func NewExternalInfo added in v0.36.0

func NewExternalInfo(ds model.DataStore, lfm *lastfm.Client, spf *spotify.Client) ExternalInfo

type MediaStreamer

type MediaStreamer interface {
	NewStream(ctx context.Context, id string, reqFormat string, reqBitRate int) (*Stream, error)
}

type NowPlaying added in v0.37.0

type NowPlaying interface {
	// Insert at the head of the queue
	Enqueue(*NowPlayingInfo) error

	// Returns all heads from all playerIds
	GetAll() ([]*NowPlayingInfo, error)
}

This repo must have the semantics of a FIFO queue, for each playerId

func NewNowPlayingRepository added in v0.37.0

func NewNowPlayingRepository() NowPlaying

type NowPlayingInfo added in v0.37.0

type NowPlayingInfo struct {
	TrackID    string
	Start      time.Time
	Username   string
	PlayerId   int
	PlayerName string
}

type Players added in v0.37.0

type Players interface {
	Get(ctx context.Context, playerId string) (*model.Player, error)
	Register(ctx context.Context, id, client, typ, ip string) (*model.Player, *model.Transcoding, error)
}

func NewPlayers added in v0.37.0

func NewPlayers(ds model.DataStore) Players

type Stream

type Stream struct {
	io.ReadCloser
	io.Seeker
	// contains filtered or unexported fields
}

func (*Stream) ContentType

func (s *Stream) ContentType() string

func (*Stream) Duration

func (s *Stream) Duration() float32

func (*Stream) EstimatedContentLength

func (s *Stream) EstimatedContentLength() int

func (*Stream) ModTime

func (s *Stream) ModTime() time.Time

func (*Stream) Name

func (s *Stream) Name() string

func (*Stream) Seekable

func (s *Stream) Seekable() bool

type TranscodingCache

type TranscodingCache cache.FileCache

func GetTranscodingCache added in v0.37.0

func GetTranscodingCache() TranscodingCache

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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