Fixes to Add Melody Page, minor UI Tweaks
This commit is contained in:
@@ -28,7 +28,6 @@ class MelodyInfo(BaseModel):
|
||||
color: str = ""
|
||||
isTrueRing: bool = False
|
||||
previewURL: str = ""
|
||||
notes: List[int] = []
|
||||
|
||||
|
||||
class MelodyAttributes(BaseModel):
|
||||
|
||||
@@ -82,7 +82,7 @@ async def upload_file(
|
||||
|
||||
url = service.upload_file(melody_id, contents, file.filename, content_type)
|
||||
|
||||
# Update the melody document with the new URL if it's a preview
|
||||
# Update the melody document with the file URL
|
||||
if file_type == "preview":
|
||||
service.update_melody(melody_id, MelodyUpdate(
|
||||
information=MelodyInfo(
|
||||
@@ -90,6 +90,8 @@ async def upload_file(
|
||||
previewURL=url,
|
||||
)
|
||||
))
|
||||
elif file_type == "binary":
|
||||
service.update_melody(melody_id, MelodyUpdate(url=url))
|
||||
|
||||
return {"url": url, "file_type": file_type}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user