mirror of
https://github.com/navidrome/navidrome.git
synced 2025-08-10 00:52:20 +00:00
* Add migration converting playqueue current to index * refactor Signed-off-by: Deluan <deluan@navidrome.org> * fix(queue): ensure valid current index and improve test coverage Signed-off-by: Deluan <deluan@navidrome.org> --------- Signed-off-by: Deluan <deluan@navidrome.org>
24 lines
670 B
Go
24 lines
670 B
Go
package model
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
type PlayQueue struct {
|
|
ID string `structs:"id" json:"id"`
|
|
UserID string `structs:"user_id" json:"userId"`
|
|
Current int `structs:"current" json:"current"`
|
|
Position int64 `structs:"position" json:"position"`
|
|
ChangedBy string `structs:"changed_by" json:"changedBy"`
|
|
Items MediaFiles `structs:"-" json:"items,omitempty"`
|
|
CreatedAt time.Time `structs:"created_at" json:"createdAt"`
|
|
UpdatedAt time.Time `structs:"updated_at" json:"updatedAt"`
|
|
}
|
|
|
|
type PlayQueues []PlayQueue
|
|
|
|
type PlayQueueRepository interface {
|
|
Store(queue *PlayQueue) error
|
|
Retrieve(userId string) (*PlayQueue, error)
|
|
}
|