mirror of
https://github.com/navidrome/navidrome.git
synced 2026-08-04 22:00:20 +00:00
* initial scrobble api * feat: add scrobble retrieval api * address feedback (1) * fix spelling * be explicit about get * add primary key field, update index, remove rowid references * use unix timestamp for input and output --------- Co-authored-by: Deluan Quintão <deluan@navidrome.org>
19 lines
549 B
Go
19 lines
549 B
Go
package model
|
|
|
|
import "time"
|
|
|
|
type Scrobble struct {
|
|
ID int64 `structs:"id" json:"id"`
|
|
MediaFileID string `structs:"media_file_id" json:"mediaFileId"`
|
|
UserID string `json:"-"`
|
|
SubmissionTime int64 `structs:"submission_time" json:"submissionTime"`
|
|
}
|
|
|
|
type ScrobbleRepository interface {
|
|
CountAll(options ...QueryOptions) (int64, error)
|
|
Get(id string) (*Scrobble, error)
|
|
GetAll(options ...QueryOptions) (Scrobbles, error)
|
|
RecordScrobble(mediaFileID string, submissionTime time.Time) error
|
|
}
|
|
|
|
type Scrobbles []Scrobble
|