multi

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

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 New

func New() *Library

func (*Library) Add

func (m *Library) Add(s Server, lib library.Library)

Add registers a server. The first one added is current.

func (*Library) AddToPlaylist added in v0.10.0

func (m *Library) AddToPlaylist(ctx context.Context, id string, tracks []library.Track) error

func (*Library) AlbumTracks

func (m *Library) AlbumTracks(ctx context.Context, albumID string) ([]library.Track, error)

func (*Library) ArtistAlbums

func (m *Library) ArtistAlbums(ctx context.Context, artistID string) ([]library.Album, error)

func (*Library) ArtistIndex

func (m *Library) ArtistIndex(ctx context.Context) ([]library.Letter, error)

func (*Library) Artists

func (m *Library) Artists(ctx context.Context, offset, limit int) ([]library.Artist, int, error)

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) Current

func (m *Library) Current() Server

func (*Library) DeletePlaylist added in v0.15.0

func (m *Library) DeletePlaylist(ctx context.Context, id string) error

func (*Library) MovePlaylistTrack added in v0.10.0

func (m *Library) MovePlaylistTrack(ctx context.Context, id string, from, to int) error

func (*Library) PlaylistTracks added in v0.9.0

func (m *Library) PlaylistTracks(ctx context.Context, id string) ([]library.Track, error)

func (*Library) Playlists added in v0.9.0

func (m *Library) Playlists(ctx context.Context) ([]library.Playlist, error)

Playlists asks every server and lists what answers, in registered order.

func (*Library) RecentAlbums

func (m *Library) RecentAlbums(ctx context.Context, offset, limit int) ([]library.Album, error)

func (*Library) RemoveFromPlaylist added in v0.10.0

func (m *Library) RemoveFromPlaylist(ctx context.Context, id string, index int) error

func (*Library) RenamePlaylist added in v0.15.0

func (m *Library) RenamePlaylist(ctx context.Context, id, name string) error

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.

func (*Library) Search

func (m *Library) Search(ctx context.Context, q string) (library.SearchResult, error)

func (*Library) Servers

func (m *Library) Servers() []Server

func (*Library) SetCurrent

func (m *Library) SetCurrent(id string) bool

func (*Library) Similar added in v0.19.0

func (m *Library) Similar(ctx context.Context, t library.Track, n int) ([]library.Track, error)

Similar asks the track's own server; a server that cannot suggest returns nothing rather than an error.

func (*Library) Stream

func (m *Library) Stream(ctx context.Context, t library.Track) (library.Stream, error)

type Server

type Server struct {
	ID, Name string
	Owned    bool
	Via      string // "local", "remote", "relay"
}

Jump to

Keyboard shortcuts

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