Versions in this module Expand all Collapse all v0 v0.0.2 Aug 13, 2026 v0.0.1 Aug 13, 2026 Changes in this version + var DEVICES_PATH = []string + type ErrStatus struct + Refused bool + Status int + TimedOut bool + func (e ErrStatus) Error() string + type FileUpload struct + Data []byte + Name string + Type string + type ServerClient struct + func New(baseUrl string, slogHandler slog.Handler) ServerClient + func (s *ServerClient) AuthToken() string + func (s *ServerClient) RegisterDevice(ctx context.Context, deviceID *uuid.UUID, deviceDetails types.DeviceBase) (newDeviceID uuid.UUID, err error) + func (s *ServerClient) SetAuthToken(token string) + func (s ServerClient) AddPlayCount(ctx context.Context, trackID uuid.UUID) error + func (s ServerClient) AddPlaylist(ctx context.Context, playlist types.Playlist) error + func (s ServerClient) AddPlaylistTrack(ctx context.Context, playlistID, albumID, trackID uuid.UUID) error + func (s ServerClient) AddSmartPlaylist(ctx context.Context, playlist types.PlaylistBase, filter types.TrackFilter) error + func (s ServerClient) CheckStatus(ctx context.Context) (h types.ServerApiInfo, err error) + func (s ServerClient) CountAlbums(ctx context.Context) (cnt int, err error) + func (s ServerClient) CountArtists(ctx context.Context) (cnt int, err error) + func (s ServerClient) CountLikedTracks(ctx context.Context) (cnt int, err error) + func (s ServerClient) CountPlaylistTracks(ctx context.Context, playlistID uuid.UUID) (int, error) + func (s ServerClient) CountPlaylists(ctx context.Context) (int, error) + func (s ServerClient) CountTracks(ctx context.Context) (cnt int, err error) + func (s ServerClient) CreateAPIToken(ctx context.Context, name string) (token string, err error) + func (s ServerClient) CreateArtist(ctx context.Context, artistData types.ArtistBase) error + func (s ServerClient) CreateUser(ctx context.Context, email, username, password string, roles []types.UserRole) error + func (s ServerClient) DeletePlaylist(ctx context.Context, id uuid.UUID) error + func (s ServerClient) DeletePlaylistTrack(ctx context.Context, id uuid.UUID) error + func (s ServerClient) DeleteToken(ctx context.Context, tokenID uuid.UUID) error + func (s ServerClient) DeleteUser(ctx context.Context, id uuid.UUID) error + func (s ServerClient) DeleteUserToken(ctx context.Context, tokenID uuid.UUID) error + func (s ServerClient) DeviceDelete(ctx context.Context, deviceID uuid.UUID) error + func (s ServerClient) DeviceDeleteToken(ctx context.Context, deviceID uuid.UUID) error + func (s ServerClient) DeviceNextTrack(ctx context.Context, deviceID uuid.UUID) (err error) + func (s ServerClient) DevicePlayPause(ctx context.Context, deviceID uuid.UUID) (err error) + func (s ServerClient) DevicePlayerAddToQueue(ctx context.Context, deviceID uuid.UUID, track types.TrackDetailed) (err error) + func (s ServerClient) DevicePlayerSetRepeat(ctx context.Context, deviceID uuid.UUID, repeatType types.RepeatType) (err error) + func (s ServerClient) DevicePlayerSetShuffle(ctx context.Context, deviceID uuid.UUID, active bool) (err error) + func (s ServerClient) DevicePlayerStop(ctx context.Context, deviceID uuid.UUID) (err error) + func (s ServerClient) DevicePreviousTrack(ctx context.Context, deviceID uuid.UUID) (err error) + func (s ServerClient) DeviceSetPlayerState(ctx context.Context, deviceID uuid.UUID, pc types.PlayerState) (err error) + func (s ServerClient) DownloadAlbumCover(ctx context.Context, albumID uuid.UUID, size imagemagick.ImageSize, ...) error + func (s ServerClient) DownloadArtistImage(ctx context.Context, artistID string, size imagemagick.ImageSize, w io.Writer) error + func (s ServerClient) DownloadMediaFile(ctx context.Context, id uuid.UUID, w io.Writer) error + func (s ServerClient) DownloadMediaFilePart(ctx context.Context, id uuid.UUID, startByte, endByte int, w io.Writer) (finalBytes bool, err error) + func (s ServerClient) DownloadPlaylistImage(ctx context.Context, id uuid.UUID, size imagemagick.ImageSize, w io.Writer) error + func (s ServerClient) FilterTracks(ctx context.Context, filter types.TrackFilter, page, limit int) (types.ListPaginationPayload[types.TrackDetailed], error) + func (s ServerClient) GetAlbum(ctx context.Context, albumID uuid.UUID) (album types.Album, err error) + func (s ServerClient) GetAlbumArtist(ctx context.Context, albumID, artistID uuid.UUID, role types.ArtistRole) (albumArtist types.AlbumArtist, err error) + func (s ServerClient) GetAlbumArtistByID(ctx context.Context, id uuid.UUID) (albumArtist types.AlbumArtist, err error) + func (s ServerClient) GetAlbumDetailed(ctx context.Context, albumID uuid.UUID) (album types.AlbumDetailed, err error) + func (s ServerClient) GetAlbumTrack(ctx context.Context, albumID uuid.UUID, discNumber, trackNumber int) (albumTrack types.AlbumTrack, err error) + func (s ServerClient) GetAlbumTrackByID(ctx context.Context, id uuid.UUID) (albumTrack types.AlbumTrack, err error) + func (s ServerClient) GetArtist(ctx context.Context, artistID uuid.UUID) (artist types.Artist, err error) + func (s ServerClient) GetArtistTopTracks(ctx context.Context, artistID uuid.UUID) ([]types.TrackDetailed, error) + func (s ServerClient) GetLike(ctx context.Context, id uuid.UUID) (like types.Like, err error) + func (s ServerClient) GetMediaFile(ctx context.Context, id uuid.UUID) (mediaFile types.MediaFile, err error) + func (s ServerClient) GetPlaylist(ctx context.Context, id uuid.UUID) (playlist types.Playlist, err error) + func (s ServerClient) GetPlaylistTrack(ctx context.Context, id uuid.UUID) (playlistTrack types.PlaylistTrack, err error) + func (s ServerClient) GetRating(ctx context.Context, id uuid.UUID) (rating types.Rating, err error) + func (s ServerClient) GetSmartPlaylistArtist(ctx context.Context, id uuid.UUID) (artist types.SmartPlaylistArtist, err error) + func (s ServerClient) GetSmartPlaylistContent(ctx context.Context, id uuid.UUID) (content types.SmartPlaylistContent, err error) + func (s ServerClient) GetSyncState(ctx context.Context, changesSince time.Time) (syncState types.SyncState, err error) + func (s ServerClient) GetTrack(ctx context.Context, trackID uuid.UUID) (track types.Track, err error) + func (s ServerClient) GetTrackAnalysisByID(ctx context.Context, id uuid.UUID) (trackAnalysis types.TrackAnalysis, err error) + func (s ServerClient) GetTrackArtistByID(ctx context.Context, id uuid.UUID) (trackArtist types.TrackArtist, err error) + func (s ServerClient) GetTrackDetailed(ctx context.Context, trackID, albumID uuid.UUID) (track types.TrackDetailed, err error) + func (s ServerClient) GetTrackRatings(ctx context.Context, trackID uuid.UUID) (ratings []types.Rating, err error) + func (s ServerClient) GetUser(ctx context.Context) (user types.UserDetails, err error) + func (s ServerClient) ImportAlbum(ctx context.Context, r io.Reader, filename string, musicbrainzID *string) error + func (s ServerClient) LikeTrack(ctx context.Context, trackID uuid.UUID) error + func (s ServerClient) ListAlbums(ctx context.Context, sortBy database.SortBy, sortOrder database.SortOrder) (albums []types.AlbumDetailed, err error) + func (s ServerClient) ListAlbumsByArtist(ctx context.Context, artistID uuid.UUID, sortBy database.SortBy, ...) (albums []types.AlbumDetailed, err error) + func (s ServerClient) ListArtists(ctx context.Context, sortBy database.SortBy, sortOrder database.SortOrder) (artists []types.ArtistDetailed, err error) + func (s ServerClient) ListDevices(ctx context.Context) (devices []types.DeviceDetailed, err error) + func (s ServerClient) ListEntityEvents(ctx context.Context) (events []types.EntityEvent, err error) + func (s ServerClient) ListFeaturedAlbumsByArtist(ctx context.Context, artistID uuid.UUID, sortBy database.SortBy, ...) (albums []types.AlbumDetailed, err error) + func (s ServerClient) ListImportItems(ctx context.Context, page, limit int) (types.ListPaginationPayload[types.Import], error) + func (s ServerClient) ListLikedTracks(ctx context.Context) ([]types.TrackDetailed, error) + func (s ServerClient) ListPlaylistTracks(ctx context.Context, playlistID uuid.UUID, sortBy database.SortBy, ...) ([]types.TrackDetailed, error) + func (s ServerClient) ListPlaylists(ctx context.Context, includePublic bool, sortBy database.SortBy, ...) ([]types.Playlist, error) + func (s ServerClient) ListTracksByAlbum(ctx context.Context, albumID string) (tracks []types.Track, err error) + func (s ServerClient) ListTracksDetailedByAlbum(ctx context.Context, albumID uuid.UUID) (tracks []types.TrackDetailed, err error) + func (s ServerClient) ListUserRoles(ctx context.Context) ([]types.UserRole, error) + func (s ServerClient) ListUserTokens(ctx context.Context) (tokens []types.TokenLimited, err error) + func (s ServerClient) ListUsers(ctx context.Context, includeMachineUsers bool) (users []types.UserDetails, err error) + func (s ServerClient) Login(ctx context.Context, email, password string, longLivedToken bool) (resp types.LoginResp, err error) + func (s ServerClient) Logout(ctx context.Context) (err error) + func (s ServerClient) RateTrack(ctx context.Context, trackID uuid.UUID, value int) error + func (s ServerClient) SearchFull(ctx context.Context, searchTerm string) (si []types.SearchItem, err error) + func (s ServerClient) SearchMusicBrainz(ctx context.Context, artist, album string) (types.ListPayload[musicbrainz.SearchResults], error) + func (s ServerClient) SubscribeDeviceEvents(ctx context.Context, deviceID uuid.UUID, handler sse.EventHandler) error + func (s ServerClient) SyncPlayHistory(ctx context.Context, changesSince time.Time, newItems []types.PlayHistory) (syncState types.PlayHistorySyncState, err error) + func (s ServerClient) UnlikeTrack(ctx context.Context, trackID uuid.UUID) error + func (s ServerClient) UpdateAlbum(ctx context.Context, albumID uuid.UUID, albumData types.AlbumUpdate) error + func (s ServerClient) UpdateArtist(ctx context.Context, artistID uuid.UUID, artistData types.Artist) error + func (s ServerClient) UpdatePlayContext(ctx context.Context, pc types.PlayContext) error + func (s ServerClient) UpdatePlaybackState(ctx context.Context, ps types.PlaybackState) error + func (s ServerClient) UpdatePlaylist(ctx context.Context, id uuid.UUID, data types.Playlist) error + func (s ServerClient) UpdateProfile(ctx context.Context, data types.UpdateProfileReq) error + func (s ServerClient) UpdateTrack(ctx context.Context, id uuid.UUID, data types.TrackUpdate) error + func (s ServerClient) UpdateUser(ctx context.Context, userID uuid.UUID, email, username string, ...) error + func (s ServerClient) UploadAlbumImage(ctx context.Context, id uuid.UUID, img FileUpload) error + func (s ServerClient) UploadArtistImage(ctx context.Context, artistID uuid.UUID, img FileUpload) error + func (s ServerClient) UploadPlaylistImage(ctx context.Context, id uuid.UUID, img FileUpload) error + func (s ServerClient) UploadUserImage(ctx context.Context, r io.Reader, filename string) error