activity

package
v0.23.3 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package activity manages user activity data.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidUser         = errors.New("invalid user")
	ErrInvalidTrackEvent   = errors.New("invalid track event")
	ErrInvalidEpisodeEvent = errors.New("invalid episode event")
	ErrInvalidMovieEvent   = errors.New("invalid movie event")
	ErrTrackNotFound       = errors.New("track not found")
	ErrMovieNotFound       = errors.New("movie not found")
	ErrEpisodeNotFound     = errors.New("episode not found")
	ErrReleaseNotFound     = errors.New("release not found")
)

Functions

This section is empty.

Types

type Activity

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

func NewActivity

func NewActivity(config *config.Config) *Activity

func (*Activity) BuildChart added in v0.23.0

func (a *Activity) BuildChart(ctx Context, d date.DateRange) *view.TrackCharts

func (*Activity) Close

func (a *Activity) Close()

func (*Activity) CreateEvents

func (a *Activity) CreateEvents(ctx Context, events Events) error

func (*Activity) DeleteUserEvents

func (a *Activity) DeleteUserEvents(ctx Context) error

func (*Activity) Movies

func (a *Activity) Movies(ctx Context, start, end time.Time) []ActivityMovie

func (*Activity) Open

func (a *Activity) Open() error

func (*Activity) TopArtists added in v0.21.0

func (a *Activity) TopArtists(ctx Context, tracks []ActivityTrack) []ActivityArtist

func (*Activity) TopReleases added in v0.21.0

func (a *Activity) TopReleases(ctx Context, tracks []ActivityTrack) []ActivityRelease

func (*Activity) TopTracks added in v0.21.0

func (a *Activity) TopTracks(ctx Context, start, end time.Time) []ActivityTrack

func (*Activity) TrackCountsByDay added in v0.23.0

func (a *Activity) TrackCountsByDay(ctx Context, start, end time.Time) []ActivityCount

func (*Activity) TrackCountsByMonth added in v0.23.0

func (a *Activity) TrackCountsByMonth(ctx Context, start, end time.Time) []ActivityCount

func (*Activity) TrackDayCounts added in v0.23.0

func (a *Activity) TrackDayCounts(ctx Context, d date.DateRange) *view.TrackCounts

func (*Activity) TrackMonthCounts added in v0.23.0

func (a *Activity) TrackMonthCounts(ctx Context, d date.DateRange) *view.TrackCounts

func (*Activity) Tracks

func (a *Activity) Tracks(ctx Context, start, end time.Time) []ActivityTrack

func (*Activity) UserScrobble

func (a *Activity) UserScrobble(user auth.User, s Scrobble, music *music.Music) error

Add a scrobble with an MBID that should match a track we have

type Context

type Context interface {
	Music() *music.Music
	Podcast() *podcast.Podcast
	User() auth.User
	Video() *video.Video
}

Jump to

Keyboard shortcuts

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