fixed add track to queue

This commit is contained in:
Matteo Baldi 2025-08-02 11:53:43 +02:00
parent dec89ef9de
commit f3c868a050
3 changed files with 21 additions and 17 deletions

View file

@ -23,6 +23,7 @@ class QueueItem(BaseModel):
voti: int = 0
class QueueItemCreate(BaseModel):
id: str
titolo: str
coverUrl: str
color: str
@ -42,12 +43,8 @@ class VoteUpdate(BaseModel):
async def add_item(item: QueueItemCreate):
"""POST: Aggiunge un nuovo item alla queue"""
try:
# Genera un ID univoco
import uuid
item_id = str(uuid.uuid4())
new_item = {
"id": item_id,
"id": item.id,
"titolo": item.titolo,
"coverUrl": item.coverUrl,
"color": item.color,