convert...

This commit is contained in:
Robert 2024-03-19 01:04:00 +07:00
parent 358b8f2273
commit 1dd8e119bf
No known key found for this signature in database
GPG Key ID: F631C7FD957D5F22

View File

@ -41,7 +41,7 @@ class FileUploaderService:
if uploaded_file:
return
if file_url.endswith(".mp3"):
if file_url.endswith(".mp3") or file_url.endswith(".ogg"):
converted_content = await self.audio_converter_service.mp3_to_ogg(
mp3=BytesIO((await self.client.get(file_url)).read())
@ -51,11 +51,6 @@ class FileUploaderService:
file_content=converted_content
)
elif file_url.endswith(".ogg"):
uploaded_file_id = await self.planfix_client.upload_file(
file_content=BytesIO((await self.client.get(file_url)).read())
)
else:
uploaded_file_id = await self.planfix_client.upload_file_from_url(
file_url