handler

package
v0.0.0-...-64e8138 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddArtistIdentifierRequest

type AddArtistIdentifierRequest struct {
	ArtistID   int    `json:"artist_id" validate:"required" example:"1"`
	Identifier string `json:"identifier" validate:"required" example:"beatles"`
}

type AddSongToPlaylistRequest

type AddSongToPlaylistRequest struct {
	SongID uuid.UUID `json:"song_id" validate:"required" example:"00000000-0000-0000-0000-000000000000"`
}

type Album

type Album struct {
	ID          uuid.UUID `json:"id"`
	Title       string    `json:"title"`
	ReleaseDate time.Time `json:"release_date"`
	ArtistName  string    `json:"artist_name"` // Computed
	Songs       []Song    `json:"songs"`
	CreatedAt   time.Time `json:"created_at"`
}

func FromAlbumModel

func FromAlbumModel(m model.Album) Album

type AlbumHasCoverResponse

type AlbumHasCoverResponse struct {
	HasCover bool `json:"has_cover" example:"true"`
}

type Artist

type Artist struct {
	ID          uuid.UUID          `json:"id"`
	Name        string             `json:"name"`
	Albums      []Album            `json:"albums"`
	Identifiers []ArtistIdentifier `json:"identifiers"`
	CreatedAt   time.Time          `json:"created_at"`
}

func FromArtistModel

func FromArtistModel(m model.Artist) Artist

type ArtistIdentifier

type ArtistIdentifier struct {
	ID         uuid.UUID `json:"id"`
	ArtistID   uuid.UUID `json:"artist_id"`
	Identifier string    `json:"identifier"`
}

type AssignAlbumCoverByPathRequest

type AssignAlbumCoverByPathRequest struct {
	AlbumID    uuid.UUID `json:"album_id" validate:"required" example:"00000000-0000-0000-0000-000000000000"`
	SourcePath string    `json:"source_path" validate:"required" example:"/app/storage/downloads/cover.jpg"`
}

type AssignAlbumCoverResponse

type AssignAlbumCoverResponse struct {
	Status string `json:"status" example:"Cover assigned to album successfully"`
}

type AssignFileByPathRequest

type AssignFileByPathRequest struct {
	SongID     uuid.UUID `json:"song_id" validate:"required" example:"00000000-0000-0000-0000-000000000000"`
	SourcePath string    `json:"source_path" validate:"required" example:"/app/storage/downloads/song.flac"`
}

type AssignFileToSongRequest

type AssignFileToSongRequest struct {
	SongID uuid.UUID `json:"song_id" validate:"required" example:"00000000-0000-0000-0000-000000000000"`
}

type AssignFileToSongResponse

type AssignFileToSongResponse struct {
	Status string   `json:"status" example:"File assigned to song successfully"`
	File   SongFile `json:"file"`
}

type BatchIDRequest

type BatchIDRequest struct {
	IDs []uuid.UUID `json:"ids" validate:"required"`
}

type CategoriesResponse

type CategoriesResponse struct {
	Categories []string `json:"categories" example:"general,rock"`
}

type CompleteSetupRequest

type CompleteSetupRequest struct {
	Username                string `json:"username" validate:"required"`
	Password                string `json:"password" validate:"required"`
	ServerURL               string `json:"server_url" validate:"required,url"`
	MailCategories          string `json:"mail_categories"` // comma separated
	RequestMailAnnouncement string `json:"request_mail_announcement"`
}

type CreateAlbumRequest

type CreateAlbumRequest struct {
	Title       string    `json:"title" validate:"required" example:"Dark Side of the Moon"`
	ReleaseDate time.Time `json:"release_date" example:"1973-03-01T00:00:00Z"`
}

type CreateArtistRequest

type CreateArtistRequest struct {
	Name        string   `json:"name" validate:"required" example:"The Beatles"`
	Identifiers []string `json:"identifiers" validate:"required" example:"beatles,the-beatles"`
}

type CreatePlaylistFolderRequest

type CreatePlaylistFolderRequest struct {
	ID       uuid.UUID `json:"id" validate:"required" example:"00000000-0000-0000-0000-000000000000"`
	Name     string    `json:"name" validate:"required" example:"Favourites"`
	ParentID uuid.UUID `json:"parent_folder_id" validate:"required" example:"00000000-0000-0000-0000-000000000000"`
}

type CreatePlaylistRequest

type CreatePlaylistRequest struct {
	ID           uuid.UUID   `json:"id" validate:"required" example:"00000000-0000-0000-0000-000000000000"`
	Name         string      `json:"name" validate:"required" example:"My Playlist"`
	ParentFolder uuid.UUID   `json:"parent_folder_id" validate:"required" example:"00000000-0000-0000-0000-000000000000"`
	SongIDs      []uuid.UUID `json:"song_ids" example:"[\"00000000-0000-0000-0000-000000000000\"]"`
}

type CreatePlaylistWithContentsRequest

type CreatePlaylistWithContentsRequest struct {
	UserID  uuid.UUID   `json:"user_id" validate:"required"`
	Name    string      `json:"name" validate:"required"`
	SongIDs []uuid.UUID `json:"song_ids" validate:"required"`
}

type CreateRequestMailRequest

type CreateRequestMailRequest struct {
	Category string `json:"category" validate:"required" example:"general"`
	Message  string `json:"message" validate:"required" example:"Please add more jazz."`
}

type CreateSongRequest

type CreateSongRequest struct {
	Title      string                       `json:"title" validate:"required,max=255" example:"Song Title"`
	Artists    []service.SongCreationArtist `json:"artists" validate:"required,min=1"`
	AlbumTitle string                       `json:"album_title" example:"Abbey Road"`
	AlbumID    uuid.UUID                    `json:"album_id" example:"00000000-0000-0000-0000-000000000000"`
}

type EntityIDs

type EntityIDs struct {
	Playlists []uuid.UUID `json:"playlists"`
	Folders   []uuid.UUID `json:"folders"`
	Songs     []uuid.UUID `json:"songs"`
	Albums    []uuid.UUID `json:"albums"`
	Artists   []uuid.UUID `json:"artists"`
}

type ErrorResponse

type ErrorResponse struct {
	Error string `json:"error" example:"Validation failed"`
}

type FolderResponse

type FolderResponse struct {
	ID             uuid.UUID  `json:"id"`
	Name           string     `json:"name"`
	ParentFolderID *uuid.UUID `json:"parent_folder_id"`
}

type GetSongsResponse

type GetSongsResponse struct {
	Songs []Song `json:"songs"`
}

type Handler

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

func GigaHandler

func GigaHandler(d *gorm.DB, storage service.FileStorage, version string) *Handler

func NewHandler

func NewHandler(
	version string,
	db *gorm.DB,
	song_svc *service.SongService,
	mail_svc *service.MailService,
	artist_svc *service.ArtistService,
	album_svc *service.AlbumService,
	user_svc *service.UserService,
	playlist_svc *service.PlaylistService,
	search_svc *service.SearchService,
	stats_svc *service.StatsService,
	settings_svc *store.SettingsStore,
) *Handler

func (*Handler) AddArtistIdentifier

func (h *Handler) AddArtistIdentifier(c echo.Context) error

AddArtistIdentifier godoc @Summary Add artist identifier @Description Adds an identifier to an existing artist. Requires an admin JWT. @Tags artists @Security BearerAuth @Accept json @Produce json @Param request body AddArtistIdentifierRequest true "Identifier payload" @Success 200 {object} StatusResponse @Failure 400 {object} ErrorResponse @Failure 401 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /artists/identifiers [post]

func (*Handler) AddSongToPlaylist

func (h *Handler) AddSongToPlaylist(c *middleware.CustomContext) error

AddSongToPlaylist godoc @Summary Add song to playlist @Description Adds a song to a playlist. @Tags playlists @Security BearerAuth @Accept json @Produce json @Param playlist_id path string true "Playlist ID (UUID)" @Param request body AddSongToPlaylistRequest true "Song payload" @Success 200 {object} LibraryResponse @Failure 400 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /playlists/{playlist_id}/songs [post]

func (*Handler) AlbumHasCover

func (h *Handler) AlbumHasCover(c echo.Context) error

AlbumHasCover godoc @Summary Check if album cover exists @Description Returns whether a JPG cover exists for the album. @Tags albums @Produce json @Param id path string true "Album ID (UUID)" @Success 200 {object} AlbumHasCoverResponse @Failure 400 {object} ErrorResponse @Router /albums/covers/{id} [get]

func (*Handler) AssignAlbumCover

func (h *Handler) AssignAlbumCover(c echo.Context) error

AssignAlbumCover godoc @Summary Upload album cover @Description Uploads a JPG album cover for the album. Requires an admin JWT. @Tags albums @Security BearerAuth @Accept multipart/form-data @Produce json @Param id path string true "Album ID (UUID)" @Param cover formData file true "JPG cover image" @Success 200 {object} AssignAlbumCoverResponse @Failure 400 {object} ErrorResponse @Failure 401 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /albums/covers/{id} [post]

func (*Handler) AssignAlbumCoverByPath

func (h *Handler) AssignAlbumCoverByPath(c echo.Context) error

AssignAlbumCoverByPath godoc @Summary Assign album cover by path @Description Moves an album cover file from a shared volume path and associates it to an existing album. Requires an admin JWT. @Tags albums @Security BearerAuth @Accept json @Produce json @Param request body AssignAlbumCoverByPathRequest true "Request body" @Success 200 {object} AssignAlbumCoverResponse @Failure 400 {object} ErrorResponse @Failure 401 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /albums/covers-by-path [post]

func (*Handler) AssignFileToSong

func (h *Handler) AssignFileToSong(c echo.Context) error

AssignFileToSong godoc @Summary Assign audio file to song @Description Uploads an audio file and associates it to an existing song. Requires an admin JWT. @Tags songs @Security BearerAuth @Accept multipart/form-data @Produce json @Param song_id formData string true "Song ID (UUID)" @Param file formData file true "Audio file" @Success 200 {object} AssignFileToSongResponse @Failure 400 {object} ErrorResponse @Failure 401 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /songs/assign-file [post]

func (*Handler) AssignFileToSongByPath

func (h *Handler) AssignFileToSongByPath(c echo.Context) error

AssignFileToSongByPath godoc @Summary Assign audio file to song by path @Description Moves an audio file from a shared volume path and associates it to an existing song. Requires an admin JWT. @Tags songs @Security BearerAuth @Accept json @Produce json @Param request body AssignFileByPathRequest true "Request body" @Success 200 {object} AssignFileToSongResponse @Failure 400 {object} ErrorResponse @Failure 401 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /songs/assign-file-by-path [post]

func (*Handler) BandwidthMiddleware

func (h *Handler) BandwidthMiddleware(next echo.HandlerFunc) echo.HandlerFunc

func (*Handler) ChangePassword

func (h *Handler) ChangePassword(c echo.Context) error

ChangePassword godoc @Summary Change password @Description Updates the authenticated user's password. @Tags users @Security BearerAuth @Accept json @Produce json @Param user_id path string true "User ID (UUID)" @Param request body object true "New password" @Success 200 {string} string "Success" @Failure 400 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /users/{user_id}/password [put]

func (*Handler) CleanSongFiles

func (h *Handler) CleanSongFiles(c echo.Context) error

CleanSongFiles godoc @Summary Remove invalid song files @Description Removes SongFile records where the physical file is missing from storage. Requires an admin JWT. @Tags admin @Security BearerAuth @Success 200 {object} map[string]int64 @Failure 401 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Router /admin/files/cleanup [delete]

func (*Handler) CompleteSetup

func (h *Handler) CompleteSetup(c echo.Context) error

CompleteSetup godoc @Summary Complete initial setup @Description Sets up the admin user and initial configuration. available only if not setup. @Tags setup @Accept json @Produce json @Param request body CompleteSetupRequest true "Setup payload" @Success 200 {string} string "Success" @Failure 400 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Router /setup/complete [post]

func (*Handler) CreateAlbum

func (h *Handler) CreateAlbum(c echo.Context) error

CreateAlbum godoc @Summary Create album @Description Creates a new album. Requires an admin JWT. @Tags albums @Security BearerAuth @Accept json @Produce json @Param request body CreateAlbumRequest true "Album metadata" @Success 201 {object} Album @Failure 400 {object} ErrorResponse @Failure 401 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /albums [post]

func (*Handler) CreateArtist

func (h *Handler) CreateArtist(c echo.Context) error

CreateArtist godoc @Summary Create artist @Description Creates an artist with one or more aliases. Requires an admin JWT. @Tags artists @Security BearerAuth @Accept json @Produce json @Param request body CreateArtistRequest true "Artist payload" @Success 201 {object} Artist @Failure 400 {object} ErrorResponse @Failure 401 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /artists [post]

func (*Handler) CreatePlaylist

func (h *Handler) CreatePlaylist(c *middleware.CustomContext) error

CreatePlaylist godoc @Summary Create playlist @Description Creates a playlist under the given folder for the given user. Requires that the JWT subject matches user_id or that the token has admin privileges. @Tags playlists @Security BearerAuth @Accept json @Produce json @Param request body CreatePlaylistRequest true "Playlist payload" @Success 201 {object} Playlist @Failure 400 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Failure 409 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /playlists [post]

func (*Handler) CreatePlaylistFolder

func (h *Handler) CreatePlaylistFolder(c *middleware.CustomContext) error

CreatePlaylistFolder godoc @Summary Create folder @Description Creates a playlist folder. Requires that the JWT subject matches user_id or that the token has admin privileges. @Tags folders @Security BearerAuth @Accept json @Produce json @Param user_id path string true "User ID (UUID)" @Param request body CreatePlaylistFolderRequest true "Folder payload" @Success 201 {object} PlaylistFolder @Failure 400 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /users/{user_id}/folders [post]

func (*Handler) CreatePlaylistWithContents

func (h *Handler) CreatePlaylistWithContents(c *middleware.CustomContext) error

CreatePlaylistWithContents godoc @Summary Create playlist with contents @Description Creates a new playlist for the given user in their root folder with the given songs. Requires admin privileges. @Tags admin @Security BearerAuth @Accept json @Produce json @Param request body CreatePlaylistWithContentsRequest true "Create playlist with contents payload" @Success 201 {object} Playlist @Failure 400 {object} ErrorResponse @Failure 401 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /admin/fulfill-request [post]

func (*Handler) CreateRequestMail

func (h *Handler) CreateRequestMail(c echo.Context) error

CreateRequestMail godoc @Summary Create request mail @Description Creates a new music request mail entry. Requires authentication. @Tags mails @Security BearerAuth @Accept json @Produce json @Param request body CreateRequestMailRequest true "Request mail payload" @Success 201 {object} RequestMail @Failure 400 {object} ErrorResponse @Failure 401 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /mails [post]

func (*Handler) CreateSong

func (h *Handler) CreateSong(c echo.Context) error

@Failure 400 {object} ErrorResponse @Failure 401 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /songs [post]

func (*Handler) CreateUser

func (h *Handler) CreateUser(c echo.Context) error

CreateUser godoc @Summary Sign up @Description Creates a new user and initializes their root playlist folder. @Tags users @Accept json @Produce json @Param request body SignupRequest true "Signup payload" @Success 201 {string} string "Success" @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /users/signup [post]

func (*Handler) DeleteAlbum

func (h *Handler) DeleteAlbum(c echo.Context) error

DeleteAlbum godoc @Summary Delete album @Description Deletes an album by ID. Requires an admin JWT. @Tags albums @Security BearerAuth @Param id path string true "Album ID (UUID)" @Success 204 {string} string "No Content" @Failure 400 {object} ErrorResponse @Failure 401 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /albums/{id} [delete]

func (*Handler) DeleteArtist

func (h *Handler) DeleteArtist(c echo.Context) error

DeleteArtist godoc @Summary Delete artist @Description Deletes an artist by ID. Requires an admin JWT. @Tags artists @Security BearerAuth @Param id path string true "Artist ID (UUID)" @Success 204 {string} string "No Content" @Failure 400 {object} ErrorResponse @Failure 401 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /artists/{id} [delete]

func (*Handler) DeletePlaylist

func (h *Handler) DeletePlaylist(c *middleware.CustomContext) error

DeletePlaylist godoc (DEPRECATED: Use DeletePlaylistByID)

func (*Handler) DeletePlaylistByID

func (h *Handler) DeletePlaylistByID(c echo.Context) error

DeletePlaylist (Global) godoc @Summary Delete playlist (Global) @Description Deletes a playlist by ID. Requires admin JWT or ownership. @Tags playlists @Security BearerAuth @Param id path string true "Playlist ID (UUID)" @Success 204 {string} string "No Content" @Failure 400 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Failure 404 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /playlists/{id} [delete]

func (*Handler) DeletePlaylistFolder

func (h *Handler) DeletePlaylistFolder(c *middleware.CustomContext) error

DeletePlaylistFolder godoc @Summary Delete folder @Description Deletes a playlist folder. Admin tokens can delete any folder; non-admin tokens are restricted to their own. @Tags folders @Security BearerAuth @Param user_id path string true "User ID (UUID)" @Param folder_id path string true "Folder ID (UUID)" @Success 204 {string} string "No Content" @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /users/{user_id}/folders/{folder_id} [delete]

func (*Handler) DeleteSong

func (h *Handler) DeleteSong(c echo.Context) error

DeleteSong godoc @Summary Delete song @Description Deletes a song by ID. Requires an admin JWT. @Tags songs @Security BearerAuth @Param id path string true "Song ID (UUID)" @Success 204 {string} string "No Content" @Failure 400 {object} ErrorResponse @Failure 401 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /songs/{id} [delete]

func (*Handler) DeleteSongFile

func (h *Handler) DeleteSongFile(c echo.Context) error

DeleteSongFile godoc @Summary Delete song file @Description Deletes a song file by ID. Requires an admin JWT. @Tags songs @Security BearerAuth @Param id path string true "File ID (UUID)" @Success 204 {string} string "No Content" @Failure 400 {object} ErrorResponse @Failure 401 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /songs/files/{id} [delete]

func (*Handler) DeleteUser

func (h *Handler) DeleteUser(c *middleware.CustomContext) error

DeleteUser godoc @Summary Delete user @Description Deletes a user by ID. Users can delete their own account, or admins can delete any user. @Tags users @Security BearerAuth @Param user_id path string true "User ID (UUID)" @Success 204 {string} string "No Content" @Failure 400 {object} ErrorResponse @Failure 401 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Failure 404 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /users/{user_id} [delete]

func (*Handler) DownloadFile

func (h *Handler) DownloadFile(c *middleware.CustomContext) error

DownloadFile godoc @Summary Download song file @Description Downloads a stored song file by its file ID. @Tags songs @Produce application/octet-stream @Param file_id path string true "File ID (UUID)" @Success 200 {file} file @Failure 400 {object} ErrorResponse @Failure 404 {object} ErrorResponse @Router /songs/download/{file_id} [get]

func (*Handler) GetAlbum

func (h *Handler) GetAlbum(c echo.Context) error

GetAlbum godoc @Summary Get album @Description Returns an album by ID. @Tags albums @Produce json @Param id path string true "Album ID (UUID)" @Success 200 {object} Album @Failure 400 {object} ErrorResponse @Failure 404 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /albums/{id} [get]

func (*Handler) GetAlbumSongs

func (h *Handler) GetAlbumSongs(c echo.Context) error

GetAlbumSongs godoc @Summary List songs in album @Description Returns all songs in an album. @Tags albums @Produce json @Param id path string true "Album ID (UUID)" @Success 200 {object} GetSongsResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /albums/{id}/songs [get]

func (*Handler) GetAlbums

func (h *Handler) GetAlbums(c echo.Context) error

GetAlbums godoc @Summary List albums paginated @Description Returns paginated list of albums. @Tags albums @Produce json @Param page query int false "Page number" @Param limit query int false "Items per page" @Success 200 {object} map[string]any @Failure 500 {object} ErrorResponse @Router /admin/albums [get]

func (*Handler) GetAlbumsBatch

func (h *Handler) GetAlbumsBatch(c echo.Context) error

GetAlbumsBatch godoc @Summary Batch get albums @Description Returns a list of albums by IDs. @Tags albums @Accept json @Produce json @Param request body BatchIDRequest true "Album IDs" @Success 200 {array} Album @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /albums/batch [post]

func (*Handler) GetArtist

func (h *Handler) GetArtist(c echo.Context) error

GetArtist godoc @Summary Get artist @Description Returns an artist by ID. @Tags artists @Produce json @Param id path string true "Artist ID (UUID)" @Success 200 {object} Artist @Failure 400 {object} ErrorResponse @Failure 404 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /artists/{id} [get]

func (*Handler) GetArtists

func (h *Handler) GetArtists(c echo.Context) error

GetArtists godoc @Summary List artists paginated @Description Returns paginated list of artists. @Tags artists @Produce json @Param page query int false "Page number" @Param limit query int false "Items per page" @Success 200 {object} map[string]any @Failure 500 {object} ErrorResponse @Router /artists [get]

func (*Handler) GetArtistsBatch

func (h *Handler) GetArtistsBatch(c echo.Context) error

GetArtistsBatch godoc @Summary Batch get artists @Description Returns a list of artists by IDs. @Tags artists @Accept json @Produce json @Param request body BatchIDRequest true "Artist IDs" @Success 200 {array} Artist @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /artists/batch [post]

func (*Handler) GetBandwidth

func (h *Handler) GetBandwidth(c echo.Context) error

func (*Handler) GetCategories

func (h *Handler) GetCategories(c echo.Context) error

GetCategories godoc @Summary List request mail categories @Description Returns configured request mail categories. @Tags mails @Produce json @Success 200 {object} CategoriesResponse @Router /mails/categories [get]

func (*Handler) GetFoldersBatch

func (h *Handler) GetFoldersBatch(c *middleware.CustomContext) error

GetFoldersBatch godoc @Summary Batch get folders @Description Returns a list of folders by IDs. @Tags folders @Security BearerAuth @Accept json @Produce json @Param user_id path string true "User ID (UUID)" @Param request body BatchIDRequest true "Folder IDs" @Success 200 {array} FolderResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /users/{user_id}/folders/batch [post]

func (*Handler) GetLibrary

func (h *Handler) GetLibrary(c *middleware.CustomContext) error

GetLibrary godoc @Summary Get library contents @Description Returns the user's library contents (folders and playlists). @Tags library @Security BearerAuth @Produce json @Param user_id path string true "User ID (UUID)" @Success 200 {object} LibraryResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /users/{user_id}/library [get]

func (*Handler) GetMe

func (h *Handler) GetMe(c echo.Context) error

GetMe godoc @Summary Get current user @Description Returns the authenticated user's profile. @Tags users @Security BearerAuth @Produce json @Success 200 {object} User @Failure 401 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /users/me [get]

func (*Handler) GetNextRequestMail

func (h *Handler) GetNextRequestMail(c echo.Context) error

GetNextRequestMail godoc @Summary Get next pending request mail @Description Returns the next pending request mail (if any). Requires an admin JWT. @Tags mails @Security BearerAuth @Produce json @Success 200 {object} RequestMail @Failure 401 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Failure 404 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /mails/next [get]

func (*Handler) GetPlaylist

func (h *Handler) GetPlaylist(c *middleware.CustomContext) error

GetPlaylist godoc @Summary Get playlist @Description Returns a playlist with songs, song files, album and artist preloaded. @Tags playlists @Security BearerAuth @Produce json @Param user_id path string true "User ID (UUID)" @Param playlist_id path string true "Playlist ID (UUID)" @Success 200 {object} Playlist @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /users/{user_id}/playlists/{playlist_id} [get]

func (*Handler) GetPlaylistByID

func (h *Handler) GetPlaylistByID(c echo.Context) error

GetPlaylist (Global) godoc @Summary Get playlist (Global) @Description Returns a playlist by ID. Requires admin JWT or ownership. @Tags playlists @Security BearerAuth @Produce json @Param id path string true "Playlist ID (UUID)" @Success 200 {object} Playlist @Failure 400 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Failure 404 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /playlists/{id} [get]

func (*Handler) GetPlaylists

func (h *Handler) GetPlaylists(c echo.Context) error

GetPlaylists godoc @Summary List playlists paginated @Description Returns paginated list of playlists. @Tags playlists @Produce json @Param page query int false "Page number" @Param limit query int false "Items per page" @Success 200 {object} map[string]any @Failure 500 {object} ErrorResponse @Router /playlists [get]

func (*Handler) GetPlaylistsBatch

func (h *Handler) GetPlaylistsBatch(c *middleware.CustomContext) error

GetPlaylistsBatch godoc @Summary Batch get playlists @Description Returns a list of playlists by IDs. @Tags playlists @Security BearerAuth @Accept json @Produce json @Param user_id path string true "User ID (UUID)" @Param request body BatchIDRequest true "Playlist IDs" @Success 200 {array} Playlist @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /users/{user_id}/playlists/batch [post]

func (*Handler) GetRequestMails

func (h *Handler) GetRequestMails(c echo.Context) error

GetRequestMails godoc @Summary List request mails @Description Returns all request mails. Requires an admin JWT. @Tags mails @Security BearerAuth @Produce json @Success 200 {array} RequestMail @Failure 401 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Router /mails [get]

func (*Handler) GetServerInfo

func (h *Handler) GetServerInfo(c echo.Context) error

GetServerInfo godoc @Summary Get server info @Description Returns server version and request-mail related configuration. @Tags info @Produce json @Success 200 {object} ServerInfoResponse @Router /info [get]

func (*Handler) GetServerLogs

func (h *Handler) GetServerLogs(c echo.Context) error

GetServerLogs godoc @Summary Get server logs @Description Returns the last 100 lines of the server log file. @Tags admin @Security BearerAuth @Produce json @Success 200 {array} string @Failure 500 {object} ErrorResponse @Router /admin/logs [get]

func (*Handler) GetSettings

func (h *Handler) GetSettings(c echo.Context) error

GetSettings godoc @Summary Get system settings @Description Returns all system settings. Requires admin JWT. @Tags admin @Security BearerAuth @Produce json @Success 200 {object} map[string]string @Failure 401 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /admin/settings [get]

func (*Handler) GetSong

func (h *Handler) GetSong(c echo.Context) error

GetSong godoc @Summary Get song @Description Returns a song by ID. @Tags songs @Produce json @Param id path string true "Song ID (UUID)" @Success 200 {object} Song @Failure 400 {object} ErrorResponse @Failure 404 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /songs/{id} [get]

func (*Handler) GetSongFiles

func (h *Handler) GetSongFiles(c echo.Context) error

GetSongFiles godoc @Summary List files for a song @Description Returns all files associated with a song. @Tags songs @Produce json @Param id path string true "Song ID (UUID)" @Success 200 {array} model.SongFile @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /songs/{id}/files [get]

func (*Handler) GetSongs

func (h *Handler) GetSongs(c echo.Context) error

GetSongs godoc @Summary List songs @Description Returns the 50 latest songs, or paginated list if page/limit params are provided. @Tags songs @Produce json @Param page query int false "Page number" @Param limit query int false "Items per page" @Success 200 {object} GetSongsResponse @Failure 500 {object} ErrorResponse @Router /songs [get]

func (*Handler) GetSongsBatch

func (h *Handler) GetSongsBatch(c echo.Context) error

GetSongsBatch godoc @Summary Batch get songs @Description Returns a list of songs by IDs. @Tags songs @Accept json @Produce json @Param request body BatchIDRequest true "Song IDs" @Success 200 {array} Song @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /songs/batch [post]

func (*Handler) GetStats

func (h *Handler) GetStats(c echo.Context) error

func (*Handler) GetSync

func (h *Handler) GetSync(c *middleware.CustomContext) error

GetSync godoc @Summary Sync changes @Description Returns a manifest of changed and removed entities since the given timestamp. @Tags users @Security BearerAuth @Produce json @Param since query string false "Since timestamp (RFC3339)" @Success 200 {object} SyncManifest @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /users/me/sync [get]

func (*Handler) GetUserPlaylists

func (h *Handler) GetUserPlaylists(c *middleware.CustomContext) error

GetUserPlaylists godoc @Summary List user playlists @Description Lists playlists owned by the given user. @Tags playlists @Security BearerAuth @Produce json @Param user_id path string true "User ID (UUID)" @Success 200 {array} Playlist @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /users/{user_id}/playlists [get]

func (*Handler) GetUsers

func (h *Handler) GetUsers(c echo.Context) error

GetUsers godoc @Summary List users @Description Returns a list of users with pagination. @Tags admin @Security BearerAuth @Produce json @Param page query int false "Page number" @Param limit query int false "Items per page" @Success 200 {array} User @Failure 500 {object} ErrorResponse @Router /admin/users [get]

func (*Handler) HealthCheckHandler

func (h *Handler) HealthCheckHandler(c echo.Context) error

HealthCheckHandler godoc @Summary Health check @Description Basic liveness endpoint. @Tags info @Produce plain @Success 200 {string} string "Service is running" @Router /info/health [get]

func (*Handler) LoginUser

func (h *Handler) LoginUser(c echo.Context) error

LoginUser godoc @Summary Login @Description Validates credentials and returns a JWT Bearer token and user object @Tags users @Accept json @Produce json @Param request body LoginRequest true "Login payload" @Success 200 {object} LoginResponse @Failure 400 {object} ErrorResponse @Failure 401 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /users/login [post]

func (*Handler) MoveFolderToFolder

func (h *Handler) MoveFolderToFolder(c *middleware.CustomContext) error

MoveFolderToFolder godoc @Summary Move folder to another folder @Description Moves a folder to a different parent folder and returns the updated library. Requires that the JWT subject matches user_id or that the token has admin privileges. @Tags folders @Security BearerAuth @Accept json @Produce json @Param user_id path string true "User ID (UUID)" @Param folder_id path string true "Folder ID (UUID)" @Param request body MoveFolderRequest true "Move payload" @Success 200 {object} LibraryResponse @Failure 400 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /users/{user_id}/folders/{folder_id}/move [put]

func (*Handler) MovePlaylistToFolder

func (h *Handler) MovePlaylistToFolder(c *middleware.CustomContext) error

MovePlaylistToFolder godoc @Summary Move playlist to folder @Description Moves a playlist to a different folder. @Tags playlists @Security BearerAuth @Accept json @Produce json @Param playlist_id path string true "Playlist ID (UUID)" @Param request body MovePlaylistRequest true "Move payload" @Success 200 {object} LibraryResponse @Failure 400 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /playlists/{playlist_id}/move [put]

func (*Handler) RebalanceAllPlaylists

func (h *Handler) RebalanceAllPlaylists(c *middleware.CustomContext) error

RebalanceAllPlaylists godoc @Summary Rebalance all playlists @Description Rebalances the song order keys for all playlists in the system using the new Base62 alphabet. Requires admin privileges. @Tags admin @Security BearerAuth @Produce json @Success 200 {string} string "OK" @Failure 403 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /admin/rebalance-playlists [post]

func (*Handler) Register

func (h *Handler) Register(public *echo.Group)

func (*Handler) ReindexSearch

func (h *Handler) ReindexSearch(c echo.Context) error

ReindexSearch godoc @Summary Re-index search database @Description Deletes all documents in Meilisearch and re-indexes them from the database. Requires an admin JWT. @Tags admin @Security BearerAuth @Success 200 {string} string "OK" @Failure 401 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Router /search/reindex [post]

func (*Handler) RemoveOrphans

func (h *Handler) RemoveOrphans(c echo.Context) error

RemoveOrphans godoc @Summary Remove orphan entities @Description Removes orphan songs, albums, artists, broken links, and related metadata (identifiers, files). Requires an admin JWT. @Tags admin @Security BearerAuth @Success 200 {object} map[string]int64 @Failure 401 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Router /admin/orphans [delete]

func (*Handler) RemoveSongFromPlaylist

func (h *Handler) RemoveSongFromPlaylist(c *middleware.CustomContext) error

RemoveSongFromPlaylist godoc @Summary Remove song from playlist @Description Removes a song from a playlist. @Tags playlists @Security BearerAuth @Produce json @Param playlist_id path string true "Playlist ID (UUID)" @Param song_id path string true "Song ID (UUID)" @Success 200 {object} LibraryResponse @Failure 400 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /playlists/{playlist_id}/songs/{song_id} [delete]

func (*Handler) RenamePlaylist

func (h *Handler) RenamePlaylist(c *middleware.CustomContext) error

RenamePlaylist godoc (DEPRECATED: Use UpdatePlaylistByID)

func (*Handler) RenamePlaylistFolder

func (h *Handler) RenamePlaylistFolder(c *middleware.CustomContext) error

RenamePlaylistFolder godoc @Summary Rename folder @Description Renames a playlist folder and returns the updated library. Requires that the JWT subject matches user_id or that the token has admin privileges. @Tags folders @Security BearerAuth @Accept json @Produce json @Param user_id path string true "User ID (UUID)" @Param folder_id path string true "Folder ID (UUID)" @Param request body RenameFolderRequest true "Rename payload" @Success 200 {object} LibraryResponse @Failure 400 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /users/{user_id}/folders/{folder_id}/rename [put]

func (*Handler) RunDoctor

func (h *Handler) RunDoctor(c echo.Context) error

RunDoctor godoc @Summary Run maintenance tasks @Description Runs server-side maintenance (ensures song file durations). Requires an admin JWT. @Tags admin @Security BearerAuth @Success 200 {string} string "OK" @Failure 401 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Router /doctor [post]

func (*Handler) SearchItems

func (h *Handler) SearchItems(c echo.Context) error

SearchItems godoc @Summary Global search @Description Searches for songs, artists, and playlists using Meilisearch. @Tags search @Produce json @Param q query string true "Search query" @Param limit query int false "Results limit" @Success 200 {array} service.SearchResult @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /search [get]

func (*Handler) ServeAlbumCover

func (h *Handler) ServeAlbumCover(c echo.Context) error

ServeAlbumCover godoc @Summary Serve album cover image @Description Serves a JPG album cover. The `res` parameter selects low or high quality. @Tags images @Produce image/jpeg @Param id path string true "Album ID (UUID)" @Param res path string true "Resolution (lq|hq)" Enums(lq,hq) @Success 200 {file} file @Failure 400 {string} string "Invalid parameters" @Router /images/covers/{id}/{res} [get]

func (*Handler) SetMailStatus

func (h *Handler) SetMailStatus(c echo.Context) error

SetMailStatus godoc @Summary Set request mail status @Description Updates the status of a request mail. Requires an admin JWT. Status values: 0=pending, 1=processing, 2=completed, 3=rejected. @Tags mails @Security BearerAuth @Accept json @Produce json @Param id path int true "Mail ID" @Param request body SetMailStatusRequest true "Status payload" @Success 200 {object} MessageResponse @Failure 400 {object} ErrorResponse @Failure 401 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /mails/{id}/status [put]

func (*Handler) SetupStatus

func (h *Handler) SetupStatus(c echo.Context) error

SetupStatus godoc @Summary Check setup status @Description Returns whether the server setup has been completed. @Tags setup @Produce json @Success 200 {object} map[string]bool @Router /setup/status [get]

func (*Handler) UpdateAlbum

func (h *Handler) UpdateAlbum(c echo.Context) error

UpdateAlbum godoc @Summary Update album @Description Updates album metadata. Requires an admin JWT. @Tags albums @Security BearerAuth @Accept json @Produce json @Param id path string true "Album ID (UUID)" @Param request body UpdateAlbumRequest true "Album metadata" @Success 200 {object} Album @Failure 400 {object} ErrorResponse @Failure 401 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /albums/{id} [put]

func (*Handler) UpdateArtist

func (h *Handler) UpdateArtist(c echo.Context) error

UpdateArtist godoc @Summary Update artist @Description Updates artist metadata. Requires an admin JWT. @Tags artists @Security BearerAuth @Accept json @Produce json @Param id path string true "Artist ID (UUID)" @Param request body UpdateArtistRequest true "Artist metadata" @Success 200 {object} Artist @Failure 400 {object} ErrorResponse @Failure 401 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /artists/{id} [put]

func (*Handler) UpdatePlaylistByID

func (h *Handler) UpdatePlaylistByID(c echo.Context) error

UpdatePlaylist (Global) godoc @Summary Update playlist (Global) @Description Renames a playlist. Requires admin JWT or ownership. @Tags playlists @Security BearerAuth @Accept json @Produce json @Param id path string true "Playlist ID (UUID)" @Param request body RenamePlaylistRequest true "Rename payload" @Success 200 {object} Playlist @Failure 400 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Failure 404 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /playlists/{id} [put]

func (*Handler) UpdatePlaylistSongOrder

func (h *Handler) UpdatePlaylistSongOrder(c *middleware.CustomContext) error

UpdatePlaylistSongOrder godoc @Summary Update song order in playlist @Description Updates the order of a song in a playlist. @Tags playlists @Security BearerAuth @Produce json @Param playlist_id path string true "Playlist ID (UUID)" @Param song_id path string true "Song ID (UUID)" @Param request body map[string]string true "Order payload" @Success 200 {object} nil @Failure 400 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /playlists/{playlist_id}/songs/{song_id} [put]

func (*Handler) UpdateSettings

func (h *Handler) UpdateSettings(c echo.Context) error

UpdateSettings godoc @Summary Update system settings @Description Updates system settings (partial update). Requires admin JWT. @Tags admin @Security BearerAuth @Accept json @Produce json @Param request body map[string]string true "Settings kv pairs" @Success 200 {object} map[string]string @Failure 400 {object} ErrorResponse @Failure 401 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /admin/settings [put]

func (*Handler) UpdateSong

func (h *Handler) UpdateSong(c echo.Context) error

UpdateSong godoc @Summary Update song @Description Updates song metadata. Requires an admin JWT. @Tags songs @Security BearerAuth @Accept json @Produce json @Param id path string true "Song ID (UUID)" @Param request body UpdateSongRequest true "Song metadata" @Success 200 {object} Song @Failure 400 {object} ErrorResponse @Failure 401 {object} ErrorResponse @Failure 403 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /songs/{id} [put]

type HealthResponse

type HealthResponse string

type LibraryResponse

type LibraryResponse struct {
	Folders   []FolderResponse   `json:"folders"`
	Playlists []PlaylistResponse `json:"playlists"`
}

type LoginRequest

type LoginRequest struct {
	Username string `json:"username" validate:"required" example:"alice"`
	Password string `json:"password" validate:"required" example:"correct horse battery staple"`
}

type LoginResponse

type LoginResponse struct {
	Token    string    `json:"token" example:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."`
	Username string    `json:"username" example:"alice"`
	ID       uuid.UUID `json:"id" example:"00000000-0000-0000-0000-000000000000"`
}

type MessageResponse

type MessageResponse struct {
	Message string `json:"message" example:"Status updated"`
}

type MoveFolderRequest

type MoveFolderRequest struct {
	TargetParentID *uuid.UUID `json:"parent_folder_id" validate:"required" example:"00000000-0000-0000-0000-000000000000"`
}

type MovePlaylistRequest

type MovePlaylistRequest struct {
	TargetFolderID uuid.UUID `json:"parent_folder_id" validate:"required" example:"00000000-0000-0000-0000-000000000000"`
}

type Playlist

type Playlist struct {
	ID            uuid.UUID              `json:"id"`
	Name          string                 `json:"name"`
	FolderID      uuid.UUID              `json:"folder_id"`
	UserID        uuid.UUID              `json:"user_id"`
	PlaylistSongs []PlaylistSongResponse `json:"playlist_songs"`
	// Songs     []Song    `json:"songs"`
	User      *User     `json:"user,omitempty"`
	CreatedAt time.Time `json:"created_at"`
}

func FromPlaylistModel

func FromPlaylistModel(m model.Playlist) Playlist

type PlaylistFolder

type PlaylistFolder struct {
	ID        uuid.UUID         `json:"id"`
	Name      string            `json:"name"`
	UserID    uuid.UUID         `json:"user_id"`
	ParentID  *uuid.UUID        `json:"parent_id"`
	Children  []*PlaylistFolder `json:"children"`
	Playlists []Playlist        `json:"playlists"`
}

func FromPlaylistFolderModel

func FromPlaylistFolderModel(m model.PlaylistFolder) PlaylistFolder

type PlaylistResponse

type PlaylistResponse struct {
	ID             uuid.UUID `json:"id"`
	Name           string    `json:"name"`
	ParentFolderID uuid.UUID `json:"parent_folder_id"`
}

type PlaylistSongResponse

type PlaylistSongResponse struct {
	SongID uuid.UUID `json:"song_id"`
	Order  string    `json:"order"`
}

type RenameFolderRequest

type RenameFolderRequest struct {
	Name string `json:"name" validate:"required" example:"New Folder Name"`
}

type RenamePlaylistRequest

type RenamePlaylistRequest struct {
	Name string `json:"name" validate:"required" example:"New Name"`
}

type RequestMail

type RequestMail struct {
	ID       uint      `json:"id"`
	Category string    `json:"category"`
	Message  string    `json:"message"`
	UserID   uuid.UUID `json:"user_id"`
	Status   int       `json:"status"`
}

func FromRequestMailModel

func FromRequestMailModel(m model.RequestMail) RequestMail

type ServerInfoResponse

type ServerInfoResponse struct {
	Version                 string   `json:"version" example:"s0.0.4"`
	RequestMailAnnouncement string   `json:"request_mail_announcement" example:"Feel free to request more music!"`
	RequestMailCategories   []string `json:"request_mail_categories" example:"pop,rock"`
}

type SetMailStatusRequest

type SetMailStatusRequest struct {
	Status int `json:"status" validate:"required" example:"2"`
}

type SignupRequest

type SignupRequest struct {
	Username string `json:"username" validate:"required" example:"alice"`
	Password string `json:"password" validate:"required" example:"correct horse battery staple"`
}

type SignupResponse

type SignupResponse string

type Song

type Song struct {
	ID        uuid.UUID `json:"id" example:"00000000-0000-0000-0000-000000000000"`
	CreatedAt time.Time `json:"created_at"`
	Title     string    `json:"title" example:"Song Title"`
	AlbumID   uuid.UUID `json:"album_id"`
	Album     Album     `json:"album"`
	Artists   []Artist  `json:"artists"`
}

func FromSongModel

func FromSongModel(m model.Song) Song

type SongFile

type SongFile struct {
	ID        uuid.UUID `json:"id"`
	CreatedAt time.Time `json:"created_at"`
	Format    string    `json:"format"`
	Duration  uint      `json:"duration"`
}

func FromSongFileModels

func FromSongFileModels(ms []model.SongFile) []SongFile

type StatsResponse

type StatsResponse struct {
	TotalSongs     int64        `json:"total_songs"`
	TotalAlbums    int64        `json:"total_albums"`
	TotalArtists   int64        `json:"total_artists"`
	TotalUsers     int64        `json:"total_users"`
	TotalPlaylists int64        `json:"total_playlists"`
	Goroutines     int          `json:"goroutines"`
	Memory         string       `json:"memory"`
	Uptime         int64        `json:"uptime"`
	Cpu            float64      `json:"cpu"`
	Storage        StorageStats `json:"storage"`
}

type StatusResponse

type StatusResponse struct {
	Status string `json:"status" example:"ok"`
}

type StorageStats

type StorageStats struct {
	Total   string `json:"total"`
	Used    string `json:"used"`
	Percent int    `json:"percent"`
}

type SyncManifest

type SyncManifest struct {
	LatestServerTime time.Time `json:"latest_server_time"`
	Changed          EntityIDs `json:"changed"`
	Removed          EntityIDs `json:"removed"`
}

type UpdateAlbumRequest

type UpdateAlbumRequest struct {
	Title       string    `json:"title"`
	ReleaseDate time.Time `json:"release_date"`
}

type UpdateArtistRequest

type UpdateArtistRequest struct {
	Name string `json:"name"`
}

type UpdateSongRequest

type UpdateSongRequest struct {
	Title      string                       `json:"title" example:"Song Title"`
	Artists    []service.SongCreationArtist `json:"artists"`
	AlbumTitle string                       `json:"album_title" example:"Abbey Road"`
	AlbumID    uuid.UUID                    `json:"album_id" example:"00000000-0000-0000-0000-000000000000"`
}

type User

type User struct {
	ID           uuid.UUID `json:"id"`
	Username     string    `json:"username"`
	IsAdmin      bool      `json:"is_admin"`
	RootFolderID uuid.UUID `json:"root_folder_id"`
}

func FromUserModel

func FromUserModel(m model.User, rootFolderID uuid.UUID) User

Jump to

Keyboard shortcuts

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