state

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingFile     = errors.New("missing file")
	ErrMissingTempFile = errors.New("missing temp file")
	ErrMissingTags     = errors.New("missing tags")
)
View Source
var ErrMissingState = errors.New("state missing in context")

Functions

func Context

func Context(ctx context.Context) context.Context

func PickNewFile added in v0.3.1

func PickNewFile(ctx context.Context) error

func RemoveCurrent added in v0.3.1

func RemoveCurrent(ctx context.Context) error

func RemoveTemp added in v0.3.1

func RemoveTemp(ctx context.Context) error

func Reset added in v0.3.1

func Reset(ctx context.Context) error

func SetCurrentFile added in v0.3.1

func SetCurrentFile(ctx context.Context, path string) error

func SetListened added in v0.3.1

func SetListened(ctx context.Context, l time.Time) error

func SetListenedNow added in v0.3.1

func SetListenedNow(ctx context.Context) error

func SetTags added in v0.3.1

func SetTags(ctx context.Context, t *media.Tags) error

func SetTagsFromBrainzRecording added in v0.3.2

func SetTagsFromBrainzRecording(ctx context.Context, rec brainz.Recording) error

func SetTagsFromBrainzRelease added in v0.3.2

func SetTagsFromBrainzRelease(ctx context.Context, rel *brainz.Release) error

func SetTempFile added in v0.3.1

func SetTempFile(ctx context.Context, path string) error

Types

type State

type State struct {
	Listened    time.Time
	Tags        *media.Tags
	CurrentFile *media.Probe
	TempFile    *media.Probe
	TotalFiles  int
}

func FromContext

func FromContext(ctx context.Context) (*State, error)

func (*State) PickNewFile

func (s *State) PickNewFile(ctx context.Context) error

func (*State) RemoveCurrent

func (s *State) RemoveCurrent(ctx context.Context) error

func (*State) RemoveTemp

func (s *State) RemoveTemp() error

func (*State) Reset

func (s *State) Reset() error

func (*State) SetCurrentFile

func (s *State) SetCurrentFile(ctx context.Context, path string) error

func (*State) SetTagsFromBrainzRecording added in v0.3.2

func (s *State) SetTagsFromBrainzRecording(ctx context.Context, rec brainz.Recording) error

func (*State) SetTagsFromBrainzRelease added in v0.3.2

func (s *State) SetTagsFromBrainzRelease(ctx context.Context, rel *brainz.Release) error

func (*State) SetTempFile

func (s *State) SetTempFile(path string) error

Jump to

Keyboard shortcuts

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