File tree Expand file tree Collapse file tree 2 files changed +41
-1
lines changed
Expand file tree Collapse file tree 2 files changed +41
-1
lines changed Original file line number Diff line number Diff line change 4545
4646# JS
4747node_modules /
48- music /
4948
5049# Soulsolid
5150pocs
Original file line number Diff line number Diff line change 1+ package music
2+
3+ import (
4+ "errors"
5+ "time"
6+ )
7+
8+ var (
9+ ErrTrackInTheQueueAlready = errors .New ("track already in queue" )
10+ ErrTrackNotFoundInQueue = errors .New ("track not found in queue" )
11+ )
12+
13+ type QueueItemType string
14+
15+ // QueueItem represents an item in the import queue
16+ type QueueItem struct {
17+ ID string `json:"id"`
18+ Type QueueItemType `json:"type"`
19+ Track * Track `json:"track"`
20+ Timestamp time.Time `json:"timestamp"`
21+ JobID string `json:"job_id"`
22+ Metadata map [string ]string `json:"metadata"`
23+ }
24+
25+ // Queue defines the interface for managing import queue items
26+ type Queue interface {
27+ // Add adds a new item to the queue, return ErrAlreadyExists if already in Queue.
28+ Add (item QueueItem ) error
29+ // GetAll returns all items in the queue
30+ GetAll () map [string ]QueueItem
31+ // GetByID returns a specific item by ID
32+ GetByID (id string ) (QueueItem , error )
33+ // Remove removes an item from the queue by ID
34+ Remove (id string ) error
35+ // Clear removes all items from the queue
36+ Clear () error
37+ // GetGroupedByArtist returns items grouped by primary artist
38+ GetGroupedByArtist () map [string ][]QueueItem
39+ // GetGroupedByAlbum returns items grouped by album
40+ GetGroupedByAlbum () map [string ][]QueueItem
41+ }
You can’t perform that action at this time.
0 commit comments