Fix docker settings

This commit is contained in:
Blallo 2021-09-15 18:22:08 +02:00
parent 26181d083f
commit c2b56cc85d
No known key found for this signature in database
GPG key ID: 0CBE577C9B72DC3F
2 changed files with 6 additions and 1 deletions

View file

@ -10,3 +10,4 @@ TRANSLOGGER_OPTS = {
"set_logger_level": logging.INFO,
"setup_console_handler": True,
}
FFMPEG_OPTIONS = ["-loglevel", "warning"]

View file

@ -3,6 +3,7 @@ import logging
import tempfile
import os
from datetime import datetime, timedelta
import shutil
from subprocess import Popen
from time import sleep
from typing import Callable, Optional
@ -186,7 +187,10 @@ async def create_mp3(
if not validator(start, end, tmp_file.name):
os.unlink(tmp_file.name)
return False
os.rename(tmp_file.name, outfile)
try:
os.rename(tmp_file.name, outfile)
except OSError:
shutil.move(tmp_file.name, outfile)
return True