Files
navidrome/model/playqueue.go
T

30 lines
1017 B
Go

package model
import (
"context"
"time"
)
type PlayQueue struct {
ID string `db:"id" json:"id"`
UserID string `db:"user_id" json:"userId"`
Current int `db:"current" json:"current"`
Position int64 `db:"position" json:"position"`
ChangedBy string `db:"changed_by" json:"changedBy"`
Items MediaFiles `db:",readonly" json:"items,omitempty"`
CreatedAt time.Time `db:"created_at" json:"createdAt"`
UpdatedAt time.Time `db:"updated_at" json:"updatedAt"`
}
type PlayQueues []PlayQueue
type PlayQueueRepository interface {
Store(ctx context.Context, queue *PlayQueue, colNames ...string) error
// Retrieve returns the playqueue without loading the full MediaFiles
// (Items only contain IDs)
Retrieve(ctx context.Context, userId string) (*PlayQueue, error)
// RetrieveWithMediaFiles returns the playqueue with full MediaFiles loaded
RetrieveWithMediaFiles(ctx context.Context, userId string) (*PlayQueue, error)
Clear(ctx context.Context, userId string) error
}