2020-07-31 07:42:51 -08:00
|
|
|
package model
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"time"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type PlayQueue struct {
|
2023-12-09 09:52:17 -09:00
|
|
|
ID string `structs:"id" json:"id"`
|
|
|
|
|
UserID string `structs:"user_id" json:"userId"`
|
2025-06-10 19:00:44 -08:00
|
|
|
Current int `structs:"current" json:"current"`
|
2021-07-31 21:21:20 -08:00
|
|
|
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"`
|
2020-07-31 07:42:51 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type PlayQueues []PlayQueue
|
|
|
|
|
|
|
|
|
|
type PlayQueueRepository interface {
|
2025-06-11 08:02:31 -08:00
|
|
|
Store(queue *PlayQueue, colNames ...string) error
|
|
|
|
|
// Retrieve returns the playqueue without loading the full MediaFiles
|
|
|
|
|
// (Items only contain IDs)
|
2020-07-31 07:42:51 -08:00
|
|
|
Retrieve(userId string) (*PlayQueue, error)
|
2025-06-11 08:02:31 -08:00
|
|
|
// RetrieveWithMediaFiles returns the playqueue with full MediaFiles loaded
|
|
|
|
|
RetrieveWithMediaFiles(userId string) (*PlayQueue, error)
|
|
|
|
|
Clear(userId string) error
|
2020-07-31 07:42:51 -08:00
|
|
|
}
|