Documentation
¶
Overview ¶
Package multi joins several servers' libraries into one. Items are tagged with their server and their IDs are qualified as "server:id", so a later call routes back to the server that produced them. Search asks every server; browsing uses the current one.
Index ¶
- type Library
- func (m *Library) Add(s Server, lib library.Library)
- func (m *Library) AddToPlaylist(ctx context.Context, id string, tracks []library.Track) error
- func (m *Library) AlbumTracks(ctx context.Context, albumID string) ([]library.Track, error)
- func (m *Library) ArtistAlbums(ctx context.Context, artistID string) ([]library.Album, error)
- func (m *Library) ArtistIndex(ctx context.Context) ([]library.Letter, error)
- func (m *Library) Artists(ctx context.Context, offset, limit int) ([]library.Artist, int, error)
- func (m *Library) CreatePlaylist(ctx context.Context, name string, tracks []library.Track) (library.Playlist, error)
- func (m *Library) Current() Server
- func (m *Library) MovePlaylistTrack(ctx context.Context, id string, from, to int) error
- func (m *Library) PlaylistTracks(ctx context.Context, id string) ([]library.Track, error)
- func (m *Library) Playlists(ctx context.Context) ([]library.Playlist, error)
- func (m *Library) RecentAlbums(ctx context.Context, offset, limit int) ([]library.Album, error)
- func (m *Library) RemoveFromPlaylist(ctx context.Context, id string, index int) error
- func (m *Library) SaveQueue(ctx context.Context, name string, tracks []library.Track) ([]library.Saved, error)
- func (m *Library) Search(ctx context.Context, q string) (library.SearchResult, error)
- func (m *Library) Servers() []Server
- func (m *Library) SetCurrent(id string) bool
- func (m *Library) Stream(ctx context.Context, t library.Track) (library.Stream, error)
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Library ¶
type Library struct {
// contains filtered or unexported fields
}
func (*Library) AddToPlaylist ¶ added in v0.10.0
func (*Library) AlbumTracks ¶
func (*Library) ArtistAlbums ¶
func (*Library) ArtistIndex ¶
func (*Library) CreatePlaylist ¶ added in v0.9.0
func (m *Library) CreatePlaylist(ctx context.Context, name string, tracks []library.Track) (library.Playlist, error)
CreatePlaylist routes to the one server every track belongs to.
func (*Library) MovePlaylistTrack ¶ added in v0.10.0
func (*Library) PlaylistTracks ¶ added in v0.9.0
func (*Library) Playlists ¶ added in v0.9.0
Playlists asks every server and lists what answers, in registered order.
func (*Library) RecentAlbums ¶
func (*Library) RemoveFromPlaylist ¶ added in v0.10.0
func (*Library) SaveQueue ¶ added in v0.9.0
func (m *Library) SaveQueue(ctx context.Context, name string, tracks []library.Track) ([]library.Saved, error)
SaveQueue makes one playlist per server, named name, each holding that server's tracks in queue order. Servers go in registered order; a server that fails is reported in the error as "<name> failed: <reason>" and the rest still save. Only the first error is returned.