Documentation ¶
Overview ¶
Package activity manages user activity data.
Index ¶
- Variables
- type Activity
- func (a *Activity) Close()
- func (a *Activity) CreateEvents(ctx Context, events Events) error
- func (a *Activity) DeleteUserEvents(ctx Context) error
- func (a *Activity) Movies(ctx Context, start, end time.Time) []Movie
- func (a *Activity) Open() error
- func (a *Activity) PopularTracks(ctx Context, start, end time.Time) []Track
- func (a *Activity) RecentMovies(ctx Context) []Movie
- func (a *Activity) RecentReleases(ctx Context) []Release
- func (a *Activity) RecentTracks(ctx Context) []Track
- func (a *Activity) Releases(ctx Context, start, end time.Time) []Release
- func (a *Activity) Tracks(ctx Context, start, end time.Time) []Track
- func (a *Activity) UserScrobble(user *auth.User, s Scrobble, music *music.Music) error
- type Context
- type Episode
- type EpisodeEvent
- type Events
- type Movie
- type MovieEvent
- type Playlist
- type Release
- type ReleaseEvent
- type Scrobble
- type Track
- type TrackEvent
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidUser = errors.New("invalid user")
)
Functions ¶
This section is empty.
Types ¶
type Activity ¶
type Activity struct {
// contains filtered or unexported fields
}
func NewActivity ¶
func (*Activity) DeleteUserEvents ¶
func (*Activity) PopularTracks ¶
func (*Activity) RecentMovies ¶
func (*Activity) RecentReleases ¶
func (*Activity) RecentTracks ¶
type EpisodeEvent ¶
type Events ¶
type Events struct { MovieEvents []MovieEvent ReleaseEvents []ReleaseEvent EpisodeEvents []EpisodeEvent TrackEvents []TrackEvent }
type MovieEvent ¶
type Playlist ¶
type Playlist struct { gorm.Model User string `gorm:"index:idx_playlist_user" json:"-"` Title string // Album title, Station name, etc. Creator string // Artist name, Podcast author Image string // Ref string // Date time.Time `gorm:"uniqueIndex:idx_playlist_date"` }
Listen is an album, playlist or podcast listening event.
type ReleaseEvent ¶
type Scrobble ¶
type Scrobble struct { Artist string `json:""` // Required Track string `json:""` // Required Timestamp time.Time `json:""` // Required Album string `json:""` // Optional AlbumArtist string `json:""` // Optional TrackNumber int `json:""` // Optional Duration int `json:""` // Optional - Length of track in seconds MBID string `json:""` // Optional - recording (or track?) MBID }
Scrobble is a track listening event.
Spec location: https://www.last.fm/api/show/track.scrobble not using: context, streamId, chosenByUser
func (Scrobble) PreferredArtist ¶
Click to show internal directories.
Click to hide internal directories.