navidrome/model/annotation.go

34 lines
909 B
Go
Raw Normal View History

2020-01-22 05:01:43 +01:00
package model
import "time"
const (
ArtistItemType = "artist"
AlbumItemType = "album"
MediaItemType = "mediaFile"
)
type Annotation struct {
AnnotationID string
UserID string
ItemID string
ItemType string
PlayCount int
PlayDate time.Time
Rating int
Starred bool
StarredAt time.Time
}
type AnnotationMap map[string]Annotation
type AnnotationRepository interface {
Get(userID, itemType string, itemID string) (*Annotation, error)
2020-01-22 07:00:00 +01:00
GetAll(userID, itemType string, options ...QueryOptions) ([]Annotation, error)
2020-01-22 05:01:43 +01:00
GetMap(userID, itemType string, itemID []string) (AnnotationMap, error)
Delete(userID, itemType string, itemID ...string) error
IncPlayCount(userID, itemType string, itemID string, ts time.Time) error
SetStar(starred bool, userID, itemType string, ids ...string) error
SetRating(rating int, userID, itemType string, itemID string) error
}