subsonic

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package subsonic implements the Subsonic/OpenSubsonic streaming API client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a Subsonic API client implementing streaming.Provider.

func New

func New(baseURL, username, password string) *Client

New creates a new Subsonic client.

func NewWithHTTPClient

func NewWithHTTPClient(baseURL, username, password string, c *http.Client) *Client

NewWithHTTPClient creates a new Subsonic client with a custom HTTP client.

func (*Client) CoverArtURL

func (c *Client) CoverArtURL(coverArtID string) string

CoverArtURL returns an authenticated URL for fetching cover art. No HTTP request is made.

func (*Client) GetAlbum

func (c *Client) GetAlbum(id string) (streaming.Album, []streaming.Track, error)

GetAlbum returns an album and its tracks.

func (*Client) GetAlbums

func (c *Client) GetAlbums(sortBy string, offset, count int) ([]streaming.Album, error)

GetAlbums returns a paginated list of albums.

func (*Client) GetArtists

func (c *Client) GetArtists() ([]streaming.Artist, error)

GetArtists returns all artists, flattening the indexed structure.

func (*Client) Ping

func (c *Client) Ping() error

Ping tests the connection to the Subsonic server.

func (*Client) Search

func (c *Client) Search(query string) (streaming.SearchResults, error)

Search performs a search across artists, albums, and tracks.

func (*Client) StreamURL

func (c *Client) StreamURL(trackID string) string

StreamURL returns an authenticated URL for streaming a track. No HTTP request is made; mpv handles the URL directly.

Jump to

Keyboard shortcuts

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