navidrome

package
v1.60.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SortAlphabeticalByName   = "alphabeticalByName"
	SortAlphabeticalByArtist = "alphabeticalByArtist"
	SortNewest               = "newest"
	SortRecent               = "recent"
	SortFrequent             = "frequent"
	SortStarred              = "starred"
	SortByYear               = "byYear"
	SortByGenre              = "byGenre"
)

Sort type constants for album browsing (Subsonic getAlbumList2 "type" parameter).

Variables

This section is empty.

Functions

func IsSubsonicStreamURL

func IsSubsonicStreamURL(path string) bool

IsSubsonicStreamURL reports whether path is a Subsonic stream or download endpoint. Used by the player to select the buffered download pipeline.

Types

type Album

type Album = provider.AlbumInfo

Album is a Navidrome/Subsonic album — aliased to the provider type.

type Artist

type Artist = provider.ArtistInfo

Artist is a Navidrome/Subsonic artist — aliased to the provider type.

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

NavidromeClient implements playlist.Provider for a Navidrome/Subsonic server.

func New

func New(serverURL, user, password string) *NavidromeClient

New creates a NavidromeClient with the given server credentials.

func NewFromConfig

func NewFromConfig(cfg config.NavidromeConfig) *NavidromeClient

NewFromConfig creates a NavidromeClient from a config.NavidromeConfig value. Returns nil if any of the required fields (URL, User, Password) are empty.

func NewFromEnv

func NewFromEnv() *NavidromeClient

NewFromEnv creates a NavidromeClient from NAVIDROME_URL, NAVIDROME_USER, and NAVIDROME_PASS environment variables. Returns nil if any are unset.

func (c *NavidromeClient) AlbumList(sortType string, offset, size int) ([]Album, error)

AlbumList returns a page of albums sorted by sortType. offset and size control pagination; size should be ≤ 500.

func (c *NavidromeClient) AlbumSortTypes() []provider.SortType
func (c *NavidromeClient) AlbumTracks(albumID string) ([]playlist.Track, error)

AlbumTracks returns all tracks for the given album ID with full metadata.

func (c *NavidromeClient) ArtistAlbums(artistID string) ([]Album, error)

ArtistAlbums returns all albums for the given artist ID.

func (c *NavidromeClient) Artists() ([]Artist, error)

Artists returns all artists from the server, flattening the index structure.

func (c *NavidromeClient) CanReportPlayback(track playlist.Track) bool
func (c *NavidromeClient) DefaultAlbumSort() string
func (c *NavidromeClient) Name() string
func (c *NavidromeClient) Ping() error

Ping verifies connectivity and credentials via the Subsonic ping.view endpoint. Returns a descriptive error on auth or network failure.

func (c *NavidromeClient) Playlists() ([]playlist.PlaylistInfo, error)
func (c *NavidromeClient) Refresh()

Refresh clears cached playlist and track data so the next Playlists/Tracks call re-fetches from the server. Implements playlist.Refresher.

func (c *NavidromeClient) ReportNowPlaying(track playlist.Track, _ time.Duration, _ bool)
func (c *NavidromeClient) ReportScrobble(track playlist.Track, _, _ time.Duration, _ bool)
func (c *NavidromeClient) SaveAlbumSort(sortType string) error
func (c *NavidromeClient) SearchTracks(_ context.Context, query string, limit int) ([]playlist.Track, error)

SearchTracks searches the Subsonic library for songs matching query using the search3.view endpoint. Implements provider.Searcher.

func (c *NavidromeClient) Tracks(id string) ([]playlist.Track, error)

Jump to

Keyboard shortcuts

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