api

package
v2.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig() error

func SaveConfig

func SaveConfig() error

func SubsonicAddToPlaylist

func SubsonicAddToPlaylist(songID string, playlistID string)

func SubsonicCoverArt

func SubsonicCoverArt(id string) ([]byte, error)

func SubsonicCoverArtUrl

func SubsonicCoverArtUrl(id string, size int) string

func SubsonicCreateShare

func SubsonicCreateShare(ID string) (string, error)

func SubsonicLoginCheck

func SubsonicLoginCheck() error

func SubsonicRate

func SubsonicRate(ID string, rating int)

func SubsonicSaveQueue

func SubsonicSaveQueue(ids []string, currentID string)

func SubsonicScrobble

func SubsonicScrobble(id string, submission bool)

func SubsonicStar

func SubsonicStar(id string)

func SubsonicStream

func SubsonicStream(id string) string

func SubsonicUnstar

func SubsonicUnstar(id string)

Types

type Album

type Album struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Artist   string `json:"artist"`
	ArtistID string `json:"artistId"`
	Duration int64  `json:"duration"`
}

func SubsonicGetAlbumList

func SubsonicGetAlbumList(searchType string, offset int) ([]Album, error)

func SubsonicGetArtist

func SubsonicGetArtist(id string) ([]Album, error)

func SubsonicSearchAlbum

func SubsonicSearchAlbum(query string, offset int) ([]Album, error)

type App

type App struct {
	ReplayGain    string `toml:"replaygain"`
	Notifications bool   `toml:"desktop_notifications"`
	DiscordRPC    bool   `toml:"discord_rich_presence"`
	MouseSupport  bool   `toml:"mouse_support"`
}

type Artist

type Artist struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

func SubsonicSearchArtist

func SubsonicSearchArtist(query string, offset int) ([]Artist, error)

type Config

type Config struct {
	App      App      `toml:"app"`
	Theme    Theme    `toml:"theme"`
	Keybinds Keybinds `toml:"keybinds"`
}
var AppConfig Config

type FavoriteKeybinds

type FavoriteKeybinds struct {
	ToggleFavorite []string `toml:"toggle_favorite"`
	ViewFavorites  []string `toml:"view_favorites"`
}

type GlobalKeybinds

type GlobalKeybinds struct {
	CycleFocusNext []string `toml:"cycle_focus_next"`
	CycleFocusPrev []string `toml:"cycle_focus_prev"`
	Back           []string `toml:"back"`
	Help           []string `toml:"help"`
	Quit           []string `toml:"quit"`
	HardQuit       []string `toml:"hard_quit"`
}

type Keybinds

type Keybinds struct {
	Global     GlobalKeybinds     `toml:"global"`
	Navigation NavigationKeybinds `toml:"navigation"`
	Search     SearchKeybinds     `toml:"search"`
	Library    LibraryKeybinds    `toml:"library"`
	Media      MediaKeybinds      `toml:"media"`
	Queue      QueueKeybinds      `toml:"queue"`
	Favorites  FavoriteKeybinds   `toml:"favorites"`
	Other      OtherKeybinds      `toml:"other"`
}

type LibraryKeybinds

type LibraryKeybinds struct {
	AddToPlaylist []string `toml:"add_to_playlist"`
	AddRating     []string `toml:"add_rating"`
	GoToAlbum     []string `toml:"go_to_album"`
	GoToArtist    []string `toml:"go_to_artist"`
}

type MediaKeybinds

type MediaKeybinds struct {
	PlayPause  []string `toml:"play_pause"`
	Next       []string `toml:"next"`
	Prev       []string `toml:"prev"`
	Shuffle    []string `toml:"shuffle"`
	Loop       []string `toml:"loop"`
	Restart    []string `toml:"restart"`
	Rewind     []string `toml:"rewind"`
	Forward    []string `toml:"forward"`
	VolumeUp   []string `toml:"volume_up"`
	VolumeDown []string `toml:"volume_down"`
}
type NavigationKeybinds struct {
	Up           []string `toml:"up"`
	Down         []string `toml:"down"`
	Top          []string `toml:"top"`
	Bottom       []string `toml:"bottom"`
	Select       []string `toml:"select"`
	PlayShuffled []string `toml:"play_shuffeled"`
}

type OtherKeybinds

type OtherKeybinds struct {
	ToggleNotifications []string `toml:"toggle_notifications"`
	CreateShareLink     []string `toml:"create_share_link"`
}

type PlayQueue

type PlayQueue struct {
	Current string `json:"current"`
	Entries []Song `json:"entry"`
}

func SubsonicGetQueue

func SubsonicGetQueue() (*PlayQueue, error)

type Playlist

type Playlist struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

func SubsonicGetPlaylists

func SubsonicGetPlaylists() ([]Playlist, error)

type QueueKeybinds

type QueueKeybinds struct {
	ToggleQueueView []string `toml:"toggle_queue_view"`
	QueueNext       []string `toml:"queue_next"`
	QueueLast       []string `toml:"queue_last"`
	RemoveFromQueue []string `toml:"remove_from_queue"`
	ClearQueue      []string `toml:"clear_queue"`
	MoveUp          []string `toml:"move_up"`
	MoveDown        []string `toml:"move_down"`
}

type SearchKeybinds

type SearchKeybinds struct {
	FocusSearch []string `toml:"focus_search"`
	FilterNext  []string `toml:"filter_next"`
	FilterPrev  []string `toml:"filter_prev"`
}

type SearchResult3

type SearchResult3 struct {
	Artists []Artist `json:"artist"`
	Albums  []Album  `json:"album"`
	Songs   []Song   `json:"song"`
}

func SubsonicGetStarred

func SubsonicGetStarred() (*SearchResult3, error)

type Server

type Server struct {
	URL      string `toml:"url"`
	Username string `toml:"username"`
	Password string `toml:"password"`
}

type ServerConfig added in v2.3.0

type ServerConfig struct {
	Server Server `toml:"server"`
}
var AppServerConfig ServerConfig

type Song

type Song struct {
	ID       string `json:"id"`
	Title    string `json:"title"`
	Artist   string `json:"artist"`
	ArtistID string `json:"artistId"`
	Album    string `json:"album"`
	AlbumID  string `json:"albumId"`
	Duration int    `json:"duration"`
	Rating   int    `json:"userRating"`
}

func SubsonicGetAlbum

func SubsonicGetAlbum(id string) ([]Song, error)

func SubsonicGetPlaylistSongs

func SubsonicGetPlaylistSongs(id string) ([]Song, error)

func SubsonicSearchSong

func SubsonicSearchSong(query string, offset int) ([]Song, error)

type SubsonicError

type SubsonicError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type SubsonicResponse

type SubsonicResponse struct {
	Response struct {
		Status            string         `json:"status"`
		User              *SubsonicUser  `json:"user,omitempty"`
		Error             *SubsonicError `json:"error,omitempty"`
		SearchResult      SearchResult3  `json:"searchResult3"`
		PlaylistContainer struct {
			Playlists []Playlist `json:"playlist"`
		} `json:"playlists"`
		PlaylistDetail struct {
			Entries []Song `json:"entry"`
		} `json:"playlist"`
		Album struct {
			Songs []Song `json:"song"`
		} `json:"album"`
		AlbumList struct {
			Albums []Album `json:"album"`
		} `json:"albumList"`
		Artist struct {
			Albums []Album `json:"album"`
		} `json:"artist"`
		Starred2 struct {
			Artist []Artist `json:"artist"`
			Album  []Album  `json:"album"`
			Song   []Song   `json:"song"`
		} `json:"starred2"`
		PlayQueue PlayQueue `json:"playQueue"`
		Shares    struct {
			ShareList []struct {
				URL string `json:"url"`
			} `json:"share"`
		} `json:"shares"`
	} `json:"subsonic-response"`
}

type SubsonicUser

type SubsonicUser struct {
	Username string `json:"username"`
	Email    string `json:"email"`
}

type Theme

type Theme struct {
	Subtle    []string `toml:"subtle"`
	Highlight []string `toml:"highlight"`
	Special   []string `toml:"special"`
}

Jump to

Keyboard shortcuts

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