apis

package
v0.16.2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2024 License: MIT Imports: 28 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 types.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 Export added in v0.16.2

type Export struct {
	Artists []ExportArtist
	Albums  []ExportAlbum
	Tracks  []ExportTrack
}

type ExportAlbum added in v0.16.2

type ExportAlbum struct {
	Id       string
	Name     string
	ArtistId string

	CoverArt string
	Year     int64
}

type ExportArtist added in v0.16.2

type ExportArtist struct {
	Id      string
	Name    string
	Picture string
}

type ExportTrack added in v0.16.2

type ExportTrack struct {
	Id   string
	Name string

	AlbumId  string
	ArtistId string

	Number   int64
	Duration int64
	Year     int64

	ExportName       string
	OriginalFilename string
	MobileFilename   string

	Created int64

	Tags []string
}

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 PostAlbumImport added in v0.16.2

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

type PostAlbumImportBody added in v0.16.2

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

func (PostAlbumImportBody) Schema added in v0.16.2

func (PostAlbumImportBody) Schema() jio.Schema

func (PostAlbumImportBody) Validate added in v0.16.2

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

Jump to

Keyboard shortcuts

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