Documentation
¶
Overview ¶
package handlers implements route handlers
Index ¶
- Variables
- func AdminDeleteUserHandler(store db.DB) http.HandlerFunc
- func AdminUpdateUserHandler(store db.DB) http.HandlerFunc
- func AttemptAutoFetchForListen(ctx context.Context, store db.DB, user *models.User, ...)
- func ClearAICacheHandler(store db.DB) http.HandlerFunc
- func CreateAliasHandler(store db.DB) http.HandlerFunc
- func CreateUserHandler(store db.DB) http.HandlerFunc
- func DeleteAlbumHandler(store db.DB) http.HandlerFunc
- func DeleteAliasHandler(store db.DB) http.HandlerFunc
- func DeleteApiKeyHandler(store db.DB) http.HandlerFunc
- func DeleteArtistHandler(store db.DB) http.HandlerFunc
- func DeleteListenHandler(store db.DB) http.HandlerFunc
- func DeleteTrackHandler(store db.DB) http.HandlerFunc
- func ExportAICacheHandler(store db.DB) http.HandlerFunc
- func ExportHandler(store db.DB) http.HandlerFunc
- func ExportSpotifyMetadataHandler(store db.DB) http.HandlerFunc
- func GenerateAIPlaylistHandler(store db.DB) http.HandlerFunc
- func GenerateApiKeyHandler(store db.DB) http.HandlerFunc
- func GetAICritiqueHandler(store db.DB) http.HandlerFunc
- func GetAIProfileCritiqueHandler(store db.DB) http.HandlerFunc
- func GetAlbumHandler(store db.DB) func(w http.ResponseWriter, r *http.Request)
- func GetAliasesHandler(store db.DB) http.HandlerFunc
- func GetApiKeysHandler(store db.DB) http.HandlerFunc
- func GetArtistHandler(store db.DB) func(w http.ResponseWriter, r *http.Request)
- func GetArtistsForItemHandler(store db.DB) http.HandlerFunc
- func GetBackgroundImageHandler() http.HandlerFunc
- func GetCfgHandler() http.HandlerFunc
- func GetClientSourcesHandler(store db.DB) http.HandlerFunc
- func GetListenActivityHandler(store db.DB) func(w http.ResponseWriter, r *http.Request)
- func GetListensHandler(store db.DB) func(w http.ResponseWriter, r *http.Request)
- func GetProfileImageHandler() http.HandlerFunc
- func GetTopAlbumsHandler(store db.DB) func(w http.ResponseWriter, r *http.Request)
- func GetTopArtistsHandler(store db.DB) func(w http.ResponseWriter, r *http.Request)
- func GetTopTracksHandler(store db.DB) func(w http.ResponseWriter, r *http.Request)
- func GetTrackHandler(store db.DB) func(w http.ResponseWriter, r *http.Request)
- func GetUserPreferencesHandler(store db.DB) http.HandlerFunc
- func GetUserThemeHandler(store db.DB) http.HandlerFunc
- func HealthHandler() http.HandlerFunc
- func ImageHandler(store db.DB) http.HandlerFunc
- func ImportAICacheHandler(store db.DB) http.HandlerFunc
- func ImportHandler(store db.DB, wWorker *worker.Worker) http.HandlerFunc
- func ImportSpotifyMetadataHandler(store db.DB) http.HandlerFunc
- func LbzSubmitListenHandler(store db.DB, mbzc mbz.MusicBrainzCaller) func(w http.ResponseWriter, r *http.Request)
- func LbzValidateTokenHandler(store db.DB) http.HandlerFunc
- func ListUsersHandler(store db.DB) http.HandlerFunc
- func LoginHandler(store db.DB) http.HandlerFunc
- func LogoutHandler(store db.DB) http.HandlerFunc
- func MeHandler(store db.DB) http.HandlerFunc
- func MergeArtistsHandler(store db.DB) http.HandlerFunc
- func MergeReleaseGroupsHandler(store db.DB) http.HandlerFunc
- func MergeTracksHandler(store db.DB) http.HandlerFunc
- func NowPlayingHandler(store db.DB) http.HandlerFunc
- func OptsFromRequest(r *http.Request) db.GetItemsOpts
- func PresencePingHandler(store db.DB) http.HandlerFunc
- func PublicProfileHandler(store db.DB) http.HandlerFunc
- func ReplaceImageHandler(store db.DB) http.HandlerFunc
- func SaveUserPreferencesHandler(store db.DB) http.HandlerFunc
- func SaveUserThemeHandler(store db.DB) http.HandlerFunc
- func SearchHandler(store db.DB) http.HandlerFunc
- func SetPrimaryAliasHandler(store db.DB) http.HandlerFunc
- func SetPrimaryArtistHandler(store db.DB) http.HandlerFunc
- func SignupHandler(store db.DB) http.HandlerFunc
- func SpotifyBulkFetchSSEHandler(store db.DB) http.HandlerFunc
- func SpotifyConfiguredHandler(store db.DB) http.HandlerFunc
- func SpotifyFetchMetadataHandler(store db.DB) http.HandlerFunc
- func SpotifySearchHandler(store db.DB) http.HandlerFunc
- func StartFullLibraryFetch(ctx context.Context, store db.DB, user *models.User)
- func StatsHandler(store db.DB) http.HandlerFunc
- func SubmitListenWithIDHandler(store db.DB) http.HandlerFunc
- func UpdateAlbumHandler(store db.DB) http.HandlerFunc
- func UpdateApiKeyLabelHandler(store db.DB) http.HandlerFunc
- func UpdateUserHandler(store db.DB) http.HandlerFunc
- func UploadBackgroundImageBase64Handler(store db.DB) http.HandlerFunc
- func UploadProfileImageBase64Handler(store db.DB) http.HandlerFunc
- func UploadProfileImageHandler(store db.DB) http.HandlerFunc
- func YearlyRecapHandler(store db.DB) http.HandlerFunc
- type AICritiqueRequest
- type AIPlaylistRequest
- type AIPlaylistResponse
- type AIPlaylistTrack
- type AIProfileCritiqueRequest
- type BeatScrobbleImport
- type CachedCritique
- type GlobalNotificationManager
- type LbzValidateResponse
- type Message
- type Notification
- type NowPlayingResponse
- type OpenRouterRequest
- type OpenRouterResponse
- type ProfileCritiquesCache
- type PublicAlbumArtist
- type PublicProfileResponse
- type PublicStatsResponse
- type PublicTopAlbum
- type PublicTopArtist
- type ReplaceImageResponse
- type SearchResults
- type ServerConfig
- type SpotifyAlbumExport
- type SpotifyArtistExport
- type SpotifyMetadataExport
- type SpotifySearchResponse
- type SpotifySearchResult
- type SpotifyTrackExport
- type StatsResponse
- type TopAlbumRecap
- type TopArtistRecap
- type TopTrackRecap
- type UserTheme
- type YearlyRecapResponse
Constants ¶
This section is empty.
Variables ¶
var ( NotificationManager = &GlobalNotificationManager{ notifications: make(map[int32][]Notification), } )
Functions ¶
func AdminDeleteUserHandler ¶ added in v0.1.30
func AdminDeleteUserHandler(store db.DB) http.HandlerFunc
Admin only: Delete User
func AdminUpdateUserHandler ¶ added in v0.1.30
func AdminUpdateUserHandler(store db.DB) http.HandlerFunc
Admin only: Update User (Promote/Demote or Password Reset)
func AttemptAutoFetchForListen ¶ added in v0.1.30
func AttemptAutoFetchForListen(ctx context.Context, store db.DB, user *models.User, trackName, artistName, albumName string)
AttemptAutoFetchForListen checks if metadata needs to be fetched for a new scrobble
func ClearAICacheHandler ¶ added in v0.1.30
func ClearAICacheHandler(store db.DB) http.HandlerFunc
ClearAICacheHandler clears the cached AI critiques when prompts are updated
func CreateAliasHandler ¶
func CreateAliasHandler(store db.DB) http.HandlerFunc
CreateAliasHandler creates new aliases for a given artist, album, or track.
func CreateUserHandler ¶ added in v0.1.30
func CreateUserHandler(store db.DB) http.HandlerFunc
Admin only: Create User
func DeleteAlbumHandler ¶
func DeleteAlbumHandler(store db.DB) http.HandlerFunc
func DeleteAliasHandler ¶
func DeleteAliasHandler(store db.DB) http.HandlerFunc
DeleteAliasHandler deletes an alias for a given artist or album ID.
func DeleteApiKeyHandler ¶
func DeleteApiKeyHandler(store db.DB) http.HandlerFunc
func DeleteArtistHandler ¶
func DeleteArtistHandler(store db.DB) http.HandlerFunc
func DeleteListenHandler ¶
func DeleteListenHandler(store db.DB) http.HandlerFunc
func DeleteTrackHandler ¶
func DeleteTrackHandler(store db.DB) http.HandlerFunc
func ExportAICacheHandler ¶ added in v0.1.30
func ExportAICacheHandler(store db.DB) http.HandlerFunc
ExportAICacheHandler exports only the AI cache data
func ExportHandler ¶
func ExportHandler(store db.DB) http.HandlerFunc
func ExportSpotifyMetadataHandler ¶ added in v0.1.30
func ExportSpotifyMetadataHandler(store db.DB) http.HandlerFunc
ExportSpotifyMetadataHandler exports all Spotify metadata to JSON
func GenerateAIPlaylistHandler ¶
func GenerateAIPlaylistHandler(store db.DB) http.HandlerFunc
func GenerateApiKeyHandler ¶
func GenerateApiKeyHandler(store db.DB) http.HandlerFunc
func GetAICritiqueHandler ¶
func GetAICritiqueHandler(store db.DB) http.HandlerFunc
func GetAIProfileCritiqueHandler ¶
func GetAIProfileCritiqueHandler(store db.DB) http.HandlerFunc
func GetAlbumHandler ¶
func GetAliasesHandler ¶
func GetAliasesHandler(store db.DB) http.HandlerFunc
GetAliasesHandler retrieves all aliases for a given artist or album ID.
func GetApiKeysHandler ¶
func GetApiKeysHandler(store db.DB) http.HandlerFunc
func GetArtistHandler ¶
func GetArtistsForItemHandler ¶
func GetArtistsForItemHandler(store db.DB) http.HandlerFunc
func GetBackgroundImageHandler ¶ added in v0.1.30
func GetBackgroundImageHandler() http.HandlerFunc
GetBackgroundImageHandler serves background images
func GetCfgHandler ¶
func GetCfgHandler() http.HandlerFunc
func GetClientSourcesHandler ¶ added in v0.1.30
func GetClientSourcesHandler(store db.DB) http.HandlerFunc
func GetListensHandler ¶
func GetProfileImageHandler ¶ added in v0.1.30
func GetProfileImageHandler() http.HandlerFunc
GetProfileImageHandler serves profile images
func GetTopAlbumsHandler ¶
func GetTopArtistsHandler ¶
func GetTopTracksHandler ¶
func GetTrackHandler ¶
func GetUserPreferencesHandler ¶
func GetUserPreferencesHandler(store db.DB) http.HandlerFunc
GetUserPreferencesHandler retrieves the user's preferences
func GetUserThemeHandler ¶
func GetUserThemeHandler(store db.DB) http.HandlerFunc
GetUserThemeHandler retrieves the user's saved theme
func HealthHandler ¶
func HealthHandler() http.HandlerFunc
func ImageHandler ¶
func ImageHandler(store db.DB) http.HandlerFunc
func ImportAICacheHandler ¶ added in v0.1.30
func ImportAICacheHandler(store db.DB) http.HandlerFunc
ImportAICacheHandler imports AI cache data from a JSON file
func ImportHandler ¶
func ImportSpotifyMetadataHandler ¶ added in v0.1.30
func ImportSpotifyMetadataHandler(store db.DB) http.HandlerFunc
ImportSpotifyMetadataHandler imports Spotify metadata from JSON
func LbzSubmitListenHandler ¶
func LbzSubmitListenHandler(store db.DB, mbzc mbz.MusicBrainzCaller) func(w http.ResponseWriter, r *http.Request)
func LbzValidateTokenHandler ¶
func LbzValidateTokenHandler(store db.DB) http.HandlerFunc
func ListUsersHandler ¶ added in v0.1.30
func ListUsersHandler(store db.DB) http.HandlerFunc
Admin only: List all users
func LoginHandler ¶
func LoginHandler(store db.DB) http.HandlerFunc
func LogoutHandler ¶
func LogoutHandler(store db.DB) http.HandlerFunc
func MergeArtistsHandler ¶
func MergeArtistsHandler(store db.DB) http.HandlerFunc
func MergeReleaseGroupsHandler ¶
func MergeReleaseGroupsHandler(store db.DB) http.HandlerFunc
func MergeTracksHandler ¶
func MergeTracksHandler(store db.DB) http.HandlerFunc
func NowPlayingHandler ¶
func NowPlayingHandler(store db.DB) http.HandlerFunc
func OptsFromRequest ¶
func OptsFromRequest(r *http.Request) db.GetItemsOpts
func PresencePingHandler ¶ added in v0.1.30
func PresencePingHandler(store db.DB) http.HandlerFunc
func PublicProfileHandler ¶
func PublicProfileHandler(store db.DB) http.HandlerFunc
func ReplaceImageHandler ¶
func ReplaceImageHandler(store db.DB) http.HandlerFunc
func SaveUserPreferencesHandler ¶
func SaveUserPreferencesHandler(store db.DB) http.HandlerFunc
SaveUserPreferencesHandler saves the user's preferences
func SaveUserThemeHandler ¶
func SaveUserThemeHandler(store db.DB) http.HandlerFunc
SaveUserThemeHandler saves the user's custom theme
func SearchHandler ¶
func SearchHandler(store db.DB) http.HandlerFunc
func SetPrimaryAliasHandler ¶
func SetPrimaryAliasHandler(store db.DB) http.HandlerFunc
sets the primary alias for albums, artists, and tracks
func SetPrimaryArtistHandler ¶
func SetPrimaryArtistHandler(store db.DB) http.HandlerFunc
func SignupHandler ¶ added in v0.1.30
func SignupHandler(store db.DB) http.HandlerFunc
func SpotifyBulkFetchSSEHandler ¶ added in v0.1.30
func SpotifyBulkFetchSSEHandler(store db.DB) http.HandlerFunc
SpotifyBulkFetchSSEHandler fetches metadata for ALL entities with real-time progress updates
func SpotifyConfiguredHandler ¶ added in v0.1.30
func SpotifyConfiguredHandler(store db.DB) http.HandlerFunc
SpotifyConfiguredHandler checks if Spotify credentials are configured
func SpotifyFetchMetadataHandler ¶ added in v0.1.30
func SpotifyFetchMetadataHandler(store db.DB) http.HandlerFunc
SpotifyFetchMetadataHandler fetches and updates metadata for an entity
func SpotifySearchHandler ¶ added in v0.1.30
func SpotifySearchHandler(store db.DB) http.HandlerFunc
SpotifySearchHandler searches Spotify for artists, albums, or tracks
func StartFullLibraryFetch ¶ added in v0.1.30
StartFullLibraryFetch runs in the background to fetch the rest of the library
func StatsHandler ¶
func StatsHandler(store db.DB) http.HandlerFunc
func SubmitListenWithIDHandler ¶
func SubmitListenWithIDHandler(store db.DB) http.HandlerFunc
func UpdateAlbumHandler ¶
func UpdateAlbumHandler(store db.DB) http.HandlerFunc
func UpdateApiKeyLabelHandler ¶
func UpdateApiKeyLabelHandler(store db.DB) http.HandlerFunc
func UpdateUserHandler ¶
func UpdateUserHandler(store db.DB) http.HandlerFunc
func UploadBackgroundImageBase64Handler ¶ added in v0.1.30
func UploadBackgroundImageBase64Handler(store db.DB) http.HandlerFunc
UploadBackgroundImageBase64Handler handles base64 encoded background image uploads
func UploadProfileImageBase64Handler ¶ added in v0.1.30
func UploadProfileImageBase64Handler(store db.DB) http.HandlerFunc
UploadProfileImageBase64Handler handles base64 encoded profile image uploads
func UploadProfileImageHandler ¶ added in v0.1.30
func UploadProfileImageHandler(store db.DB) http.HandlerFunc
UploadProfileImageHandler handles profile image uploads
func YearlyRecapHandler ¶
func YearlyRecapHandler(store db.DB) http.HandlerFunc
Types ¶
type AICritiqueRequest ¶
type AIPlaylistRequest ¶
type AIPlaylistRequest struct {
Type string `json:"type"` // mood_mix, genre_dive, discover_weekly, etc.
}
type AIPlaylistResponse ¶
type AIPlaylistResponse struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Tracks []AIPlaylistTrack `json:"tracks"`
}
type AIPlaylistTrack ¶
type AIProfileCritiqueRequest ¶
type AIProfileCritiqueRequest struct {
Period string `json:"period"`
}
type BeatScrobbleImport ¶
type CachedCritique ¶
type GlobalNotificationManager ¶ added in v0.1.30
type GlobalNotificationManager struct {
// contains filtered or unexported fields
}
GlobalNotificationManager handles user notifications from background processes
func (*GlobalNotificationManager) Add ¶ added in v0.1.30
func (nm *GlobalNotificationManager) Add(userID int32, n Notification)
func (*GlobalNotificationManager) GetAndClear ¶ added in v0.1.30
func (nm *GlobalNotificationManager) GetAndClear(userID int32) []Notification
type LbzValidateResponse ¶
type Notification ¶ added in v0.1.30
type NowPlayingResponse ¶
type OpenRouterRequest ¶
type OpenRouterResponse ¶
type ProfileCritiquesCache ¶
type ProfileCritiquesCache map[string]CachedCritique
type PublicAlbumArtist ¶
type PublicAlbumArtist struct {
Name string `json:"name"`
}
type PublicProfileResponse ¶
type PublicProfileResponse struct {
Username string `json:"username"`
Stats PublicStatsResponse `json:"stats"`
TopArtists []PublicTopArtist `json:"topArtists"`
TopAlbums []PublicTopAlbum `json:"topAlbums"`
Theme json.RawMessage `json:"theme,omitempty"`
ProfileImage string `json:"profileImage,omitempty"`
BackgroundImage string `json:"backgroundImage,omitempty"`
Preferences map[string]interface{} `json:"preferences,omitempty"`
}
type PublicStatsResponse ¶
type PublicTopAlbum ¶
type PublicTopAlbum struct {
ID int64 `json:"id"`
Title string `json:"title"`
Image string `json:"image,omitempty"`
Artists []PublicAlbumArtist `json:"artists"`
ListenCount int64 `json:"listen_count"`
}
type PublicTopArtist ¶
type ReplaceImageResponse ¶
type SearchResults ¶
type ServerConfig ¶
type SpotifyAlbumExport ¶ added in v0.1.30
type SpotifyAlbumExport struct {
Title string `json:"title"`
Artist string `json:"artist,omitempty"`
SpotifyID string `json:"spotify_id,omitempty"`
Genres []string `json:"genres,omitempty"`
Popularity int `json:"popularity,omitempty"`
ReleaseDate string `json:"release_date,omitempty"`
Label string `json:"label,omitempty"`
ReleaseDatePrecision string `json:"release_date_precision,omitempty"`
}
type SpotifyArtistExport ¶ added in v0.1.30
type SpotifyMetadataExport ¶ added in v0.1.30
type SpotifyMetadataExport struct {
Version string `json:"version"`
ExportedAt time.Time `json:"exported_at"`
Artists []SpotifyArtistExport `json:"artists"`
Albums []SpotifyAlbumExport `json:"albums"`
Tracks []SpotifyTrackExport `json:"tracks"`
}
SpotifyMetadataExport is the structure for the export JSON
type SpotifySearchResponse ¶ added in v0.1.30
type SpotifySearchResponse struct {
Results []SpotifySearchResult `json:"results"`
}
SpotifySearchResponse is the API response
type SpotifySearchResult ¶ added in v0.1.30
type SpotifySearchResult struct {
ID string `json:"id"`
Name string `json:"name"`
Artists []string `json:"artists,omitempty"`
Images []struct {
URL string `json:"url"`
Width int `json:"width"`
Height int `json:"height"`
} `json:"images"`
Type string `json:"type"`
}
SpotifySearchResult represents a simplified search result
type SpotifyTrackExport ¶ added in v0.1.30
type StatsResponse ¶
type TopAlbumRecap ¶
type TopArtistRecap ¶
type TopTrackRecap ¶
type UserTheme ¶
type UserTheme struct {
Bg string `json:"bg"`
BgSecondary string `json:"bgSecondary"`
BgTertiary string `json:"bgTertiary"`
Fg string `json:"fg"`
FgSecondary string `json:"fgSecondary"`
FgTertiary string `json:"fgTertiary"`
Primary string `json:"primary"`
PrimaryDim string `json:"primaryDim"`
Accent string `json:"accent"`
AccentDim string `json:"accentDim"`
Error string `json:"error"`
Warning string `json:"warning"`
Success string `json:"success"`
Info string `json:"info"`
}
UserTheme represents the theme data structure
type YearlyRecapResponse ¶
type YearlyRecapResponse struct {
Year int `json:"year"`
TotalScrobbles int64 `json:"totalScrobbles"`
TotalMinutes int64 `json:"totalMinutes"`
UniqueArtists int64 `json:"uniqueArtists"`
UniqueAlbums int64 `json:"uniqueAlbums"`
UniqueTracks int64 `json:"uniqueTracks"`
TopArtist *TopArtistRecap `json:"topArtist"`
TopAlbum *TopAlbumRecap `json:"topAlbum"`
TopTrack *TopTrackRecap `json:"topTrack"`
TopGenres []string `json:"topGenres"`
MostActiveMonth string `json:"mostActiveMonth"`
}
Source Files
¶
- ai_cache.go
- ai_critique.go
- ai_playlists.go
- ai_profile.go
- alias.go
- apikeys.go
- artists.go
- auth.go
- client_sources.go
- delete.go
- export.go
- get_album.go
- get_artist.go
- get_listen_activity.go
- get_listens.go
- get_top_albums.go
- get_top_artists.go
- get_top_tracks.go
- get_track.go
- handlers.go
- health.go
- image_handler.go
- import.go
- lbz_submit_listen.go
- lbz_validate.go
- manual_scrobble.go
- merge.go
- now_playing.go
- presence.go
- profile_image.go
- public_profile.go
- replace_image.go
- search.go
- server_cfg.go
- spotify.go
- spotify_background.go
- spotify_export.go
- state.go
- stats.go
- user_preferences.go
- user_theme.go
- users.go
- yearly_recap.go