Skip to content

Commit b8eb5e0

Browse files
author
Contre
committed
chore(soulsolid): quick fix
1 parent f17b2da commit b8eb5e0

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ tmp
4545

4646
# JS
4747
node_modules/
48-
music/
4948

5049
# Soulsolid
5150
pocs

src/music/queue.go

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
}

0 commit comments

Comments
 (0)