Use correct endpoint for file processing status checks

Update the file status polling mechanism to use the `/upload/api/file-status/{file_status_id}` endpoint. The `file_status_id` now includes the file extension when available, ensuring the correct identifier is sent to the API. This resolves issues with incorrect status retrieval and improves reliability of file processing checks.
This commit is contained in:
Slipstream 2025-05-21 12:34:54 -06:00
parent 59a228f7b4
commit d98a69769b
Signed by: slipstream
GPG Key ID: 13E498CE010AC6FD

View File

@ -272,8 +272,9 @@ class UploadCog(commands.Cog, name="Upload"):
max_attempts = 30 # 30 seconds max wait time max_attempts = 30 # 30 seconds max wait time
for attempt in range(max_attempts): for attempt in range(max_attempts):
try: try:
# Get the current file status # Get the current file status using the correct endpoint
file_status = await self._make_api_request("GET", f"/upload/api/file/{file_id}/status") file_status_id = f"{file_id}.{file_extension}" if file_extension else file_id
file_status = await self._make_api_request("GET", f"/upload/api/file-status/{file_status_id}")
print(f"File status poll attempt {attempt+1}: {file_status}") print(f"File status poll attempt {attempt+1}: {file_status}")
if file_status.get("access_ready", False): if file_status.get("access_ready", False):