updated buckets for storing audios in supabase

This commit is contained in:
Gaumit Kauts
2026-02-14 23:25:08 -07:00
parent f0eafcd865
commit 2f6e776818
8 changed files with 35 additions and 3 deletions

View File

@@ -36,6 +36,26 @@ def _paginate(page: int, limit: int) -> tuple[int, int]:
return start, end
def upload_storage_object(
bucket: str,
object_path: str,
content: bytes,
content_type: str = "application/octet-stream",
upsert: bool = False,
) -> Dict[str, Any]:
"""
Upload bytes to Supabase Storage and return upload response data.
"""
return (
supabase.storage.from_(bucket)
.upload(
object_path,
content,
{"content-type": content_type, "upsert": str(upsert).lower()},
)
)
# ==================== Users ====================
def create_user(payload: Dict[str, Any]) -> Dict[str, Any]: