mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-04 04:57:37 +03:00
refactor: remove annotation handling from engine
This commit is contained in:
parent
67ed830a68
commit
72d9ddf532
20 changed files with 151 additions and 386 deletions
|
@ -9,25 +9,22 @@ const (
|
|||
)
|
||||
|
||||
type Annotation struct {
|
||||
AnnotationID string
|
||||
UserID string
|
||||
ItemID string
|
||||
ItemType string
|
||||
PlayCount int
|
||||
PlayDate time.Time
|
||||
Rating int
|
||||
Starred bool
|
||||
StarredAt time.Time
|
||||
AnnID string `json:"annID" orm:"pk;column(ann_id)"`
|
||||
UserID string `json:"userID" orm:"pk;column(user_id)"`
|
||||
ItemID string `json:"itemID" orm:"pk;column(item_id)"`
|
||||
ItemType string `json:"itemType"`
|
||||
PlayCount int `json:"playCount"`
|
||||
PlayDate time.Time `json:"playDate"`
|
||||
Rating int `json:"rating"`
|
||||
Starred bool `json:"starred"`
|
||||
StarredAt time.Time `json:"starredAt"`
|
||||
}
|
||||
|
||||
type AnnotationMap map[string]Annotation
|
||||
|
||||
type AnnotationRepository interface {
|
||||
Get(userID, itemType string, itemID string) (*Annotation, error)
|
||||
GetAll(userID, itemType string, options ...QueryOptions) ([]Annotation, error)
|
||||
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
|
||||
Delete(itemType string, itemID ...string) error
|
||||
IncPlayCount(itemType, itemID string, ts time.Time) error
|
||||
SetStar(starred bool, itemType string, ids ...string) error
|
||||
SetRating(rating int, itemType, itemID string) error
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue