web

package
v0.0.0-...-65ad015 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: BSD-2-Clause Imports: 55 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Domain    = "inter.tube"
	Deployed  time.Time
	DebugMode = false
)
View Source
var (
	UseStripe bool
)

Functions

func Load

func Load()

func MIGRATE_MAKEDUMPS

func MIGRATE_MAKEDUMPS()

func MIGRATE_SORTID

func MIGRATE_SORTID()

func PanicHandler

func PanicHandler(ctx context.Context, w http.ResponseWriter, r *http.Request)

func WatchFiles

func WatchFiles() func() error

hot reload for dev

Types

type ExprEnv

type ExprEnv struct {
	ID         string
	SSID       tube.SSID
	ArtistSSID tube.SSID

	Number int
	Total  int
	Disc   int
	Discs  int
	Year   int

	Filename string
	Filetype string
	Size     int
	Duration int

	Plays    int
	LastPlay time.Time
	Resume   float64

	Title       string
	Artist      string
	Album       string
	AlbumArtist string
	Composer    string
	Genre       string
	Comment     string
	// contains filtered or unexported fields
}

func NewExprEnv

func NewExprEnv(t tube.Track) ExprEnv

func (ExprEnv) Add

func (ExprEnv) Add(a time.Time, b time.Duration) time.Time

func (ExprEnv) After

func (ExprEnv) After(a, b time.Time) bool

func (ExprEnv) AfterDuration

func (ExprEnv) AfterDuration(a, b time.Duration) bool

func (ExprEnv) AfterOrEqual

func (ExprEnv) AfterOrEqual(a, b time.Time) bool

func (ExprEnv) AfterOrEqualDuration

func (ExprEnv) AfterOrEqualDuration(a, b time.Duration) bool

func (ExprEnv) Before

func (ExprEnv) Before(a, b time.Time) bool

func (ExprEnv) BeforeDuration

func (ExprEnv) BeforeDuration(a, b time.Duration) bool

func (ExprEnv) BeforeOrEqual

func (ExprEnv) BeforeOrEqual(a, b time.Time) bool

func (ExprEnv) BeforeOrEqualDuration

func (ExprEnv) BeforeOrEqualDuration(a, b time.Duration) bool

func (ExprEnv) Date

func (ExprEnv) Date(s string) time.Time

func (ExprEnv) Days

func (ExprEnv) Days(n int) time.Duration

func (ExprEnv) Duration

func (ExprEnv) Duration(s string) time.Duration

func (ExprEnv) Equal

func (ExprEnv) Equal(a, b time.Time) bool

func (ExprEnv) EqualDuration

func (ExprEnv) EqualDuration(a, b time.Duration) bool

func (ExprEnv) Now

func (ExprEnv) Now() time.Time

func (ExprEnv) Sub

func (ExprEnv) Sub(a, b time.Time) time.Duration

type Library

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

func NewLibrary

func NewLibrary(tracks []tube.Track, stars map[tube.SSID]tube.Star) *Library

func (*Library) Albums

func (lib *Library) Albums(org organize) []*albumInfo

func (*Library) Artists

func (lib *Library) Artists(org organize) []*artistInfo

func (*Library) Genres

func (lib *Library) Genres() []*genreInfo

func (*Library) Query

func (lib *Library) Query(q string) ([]tube.Track, error)

func (*Library) TrackByID

func (lib *Library) TrackByID(id string) (tube.Track, bool)

func (*Library) Tracks

func (lib *Library) Tracks(org organize) []tube.Track

func (*Library) TracksByID

func (lib *Library) TracksByID(ids []string) []tube.Track

type PLUIMeta

type PLUIMeta struct {
	Conds []PlaylistCond
	Ver   int
}

type PlaylistCond

type PlaylistCond struct {
	Include bool   `json:"inc"`
	Attr    string `json:"attr"`
	Op      string `json:"op"`
	Val     string `json:"val"`
}

type PlaylistRequest

type PlaylistRequest struct {
	Meta struct {
		Name      string
		SortBy    string
		SortOrder string
	}
	Form struct {
		All  []PlaylistCond
		Expr string
	}
}

{"meta":{"playlist-name":"a","sort-by":"default","sort-order":"ascending"},"form":{"all":[{"inc":true,"attr":"Artist","op":"$1 == $2","val":"\"a\"","expr":"(Artist == \"a\")"}],"expr":"(Artist == \"a\")"}}

Jump to

Keyboard shortcuts

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