fixed add track to queue
This commit is contained in:
parent
dec89ef9de
commit
f3c868a050
3 changed files with 21 additions and 17 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue