apis

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrTypeArtistNotFound pyrin.ErrorType = "ARTIST_NOT_FOUND"
	ErrTypeAlbumNotFound  pyrin.ErrorType = "ALBUM_NOT_FOUND"
	ErrTypeTrackNotFound  pyrin.ErrorType = "TRACK_NOT_FOUND"
	ErrTypeInvalidFilter  pyrin.ErrorType = "INVALID_FILTER"
	ErrTypeInvalidSort    pyrin.ErrorType = "INVALID_SORT"
)

Variables

This section is empty.

Functions

func AlbumNotFound added in v0.15.0

func AlbumNotFound() *pyrin.Error

func ArtistNotFound added in v0.15.0

func ArtistNotFound() *pyrin.Error

func Body

func Body[T pyrin.Body](c pyrin.Context) (T, error)

func ConvertDBAlbum added in v0.16.2

func ConvertDBAlbum(c pyrin.Context, album database.Album) types.Album

func ConvertDBTrack added in v0.15.4

func ConvertDBTrack(c pyrin.Context, track database.Track) types.Track

func InstallAlbumHandlers

func InstallAlbumHandlers(app core.App, group pyrin.Group)

func InstallArtistHandlers

func InstallArtistHandlers(app core.App, group pyrin.Group)

func InstallAuthHandlers

func InstallAuthHandlers(app core.App, group pyrin.Group)

func InstallHandlers

func InstallHandlers(app core.App, g pyrin.Group)

func InstallPlaylistHandlers

func InstallPlaylistHandlers(app core.App, group pyrin.Group)

func InstallQueueHandlers

func InstallQueueHandlers(app core.App, group pyrin.Group)

TODO(patrik): Add back

func InstallSystemHandlers

func InstallSystemHandlers(app core.App, group pyrin.Group)

func InstallTagHandlers

func InstallTagHandlers(app core.App, group pyrin.Group)

TODO(patrik): Add back

func InstallTrackHandlers

func InstallTrackHandlers(app core.App, group pyrin.Group)

func InvalidFilter added in v0.15.0

func InvalidFilter(err error) *pyrin.Error

func InvalidSort added in v0.15.2

func InvalidSort(err error) *pyrin.Error

func ParseQueryBool added in v0.15.4

func ParseQueryBool(s string) bool

func RegisterHandlers added in v0.16.2

func RegisterHandlers(app core.App, router pyrin.Router)

func Server

func Server(app core.App) (*pyrin.Server, error)

func TrackNotFound added in v0.15.0

func TrackNotFound() *pyrin.Error

func User

func User(app core.App, c pyrin.Context) (*database.User, error)

Types

type ChangePasswordBody added in v0.17.0

type ChangePasswordBody struct {
	CurrentPassword    string `json:"currentPassword"`
	NewPassword        string `json:"newPassword"`
	NewPasswordConfirm string `json:"newPasswordConfirm"`
}

func (ChangePasswordBody) Validate added in v0.17.0

func (b ChangePasswordBody) Validate(validator validate.Validator) error

type CreateAlbum added in v0.17.0

type CreateAlbum struct {
	AlbumId string `json:"albumId"`
}

type CreateAlbumBody added in v0.17.0

type CreateAlbumBody struct {
	Name   string `json:"name"`
	Artist string `json:"artist"`
}

func (CreateAlbumBody) Schema added in v0.17.0

func (CreateAlbumBody) Schema() jio.Schema

func (CreateAlbumBody) Validate added in v0.17.0

func (b CreateAlbumBody) Validate(validator validate.Validator) error

type EditArtistBody added in v0.17.0

type EditArtistBody struct {
	Name *string `json:"name"`
}

func (EditArtistBody) Validate added in v0.17.0

func (b EditArtistBody) Validate(validator validate.Validator) error

type Export added in v0.16.2

type Export struct {
	Artists []ExportArtist `json:"artists"`
	Albums  []ExportAlbum  `json:"albums"`
	Tracks  []ExportTrack  `json:"tracks"`
}

type ExportAlbum added in v0.16.2

type ExportAlbum struct {
	Id       string `json:"id"`
	Name     string `json:"name"`
	ArtistId string `json:"artistId"`

	CoverArt string `json:"coverArt"`
	Year     int64  `json:"year"`
}

type ExportArtist added in v0.16.2

type ExportArtist struct {
	Id      string `json:"id"`
	Name    string `json:"name"`
	Picture string `json:"picture"`
}

type ExportTrack added in v0.16.2

type ExportTrack struct {
	Id   string `json:"id"`
	Name string `json:"name"`

	AlbumId  string `json:"albumId"`
	ArtistId string `json:"artistId"`

	Number   int64 `json:"number"`
	Duration int64 `json:"duration"`
	Year     int64 `json:"year"`

	ExportName       string `json:"exportName"`
	OriginalFilename string `json:"originalFilename"`
	MobileFilename   string `json:"mobileFilename"`

	Created int64 `json:"created"`

	Tags []string `json:"tags"`
}

type PatchAlbumBody added in v0.16.2

type PatchAlbumBody struct {
	Name       *string `json:"name"`
	ArtistId   *string `json:"artistId"`
	ArtistName *string `json:"artistName"`
	Year       *int64  `json:"year"`
}

func (PatchAlbumBody) Validate added in v0.16.2

func (b PatchAlbumBody) Validate(validator validate.Validator) error

type PatchTrackBody added in v0.16.2

type PatchTrackBody struct {
	Name       *string   `json:"name,omitempty"`
	ArtistId   *string   `json:"artistId,omitempty"`
	ArtistName *string   `json:"artistName,omitempty"`
	Year       *int64    `json:"year,omitempty"`
	Number     *int64    `json:"number,omitempty"`
	Tags       *[]string `json:"tags,omitempty"`
}

func (PatchTrackBody) Validate added in v0.16.2

func (b PatchTrackBody) Validate(validator validate.Validator) error

Validate implements pyrin.Body.

type UploadTracksBody added in v0.17.0

type UploadTracksBody struct {
	ForceExtractNumber bool `json:"forceExtractNumber"`
}

func (UploadTracksBody) Validate added in v0.17.0

func (b UploadTracksBody) Validate(validator validate.Validator) error

Jump to

Keyboard shortcuts

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