fix
This commit is contained in:
parent
bff53e6b07
commit
8446d83896
|
|
@ -41,13 +41,19 @@ class FileUploaderService:
|
|||
if uploaded_file:
|
||||
return
|
||||
|
||||
converted_content = await self.audio_converter_service.audio_to_ogg(
|
||||
audio=BytesIO((await self.client.get(file_url)).read())
|
||||
)
|
||||
if file_url.endswith(".ogg") or file_url.endswith(".mp3"):
|
||||
content = await self.audio_converter_service.audio_to_ogg(
|
||||
audio=BytesIO((await self.client.get(file_url)).read())
|
||||
)
|
||||
|
||||
uploaded_file_id = await self.planfix_client.upload_file(
|
||||
file_content=converted_content
|
||||
)
|
||||
uploaded_file_id = await self.planfix_client.upload_file(
|
||||
file_content=content
|
||||
)
|
||||
|
||||
else:
|
||||
uploaded_file_id = await self.planfix_client.upload_file_from_url(
|
||||
file_url
|
||||
)
|
||||
|
||||
await self.uploaded_file_repository.upsert(
|
||||
UploadedFile(file_id=uploaded_file_id, file_url=file_url)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user