Fix a bug so that old audio files are deleted correctly
This commit is contained in:
parent
7183ca8317
commit
af3d3a57c5
|
@ -98,10 +98,10 @@ def post(request):
|
|||
thought.save() # Save so that we have a file to work with
|
||||
subprocess.run(["ffmpeg",
|
||||
"-i", thought.media.path,
|
||||
"-codec:a", "aac",
|
||||
"-codec:a", "aac", "-vn",
|
||||
os.path.join(settings.MEDIA_ROOT, f"{thought.uuid}.aac")
|
||||
])
|
||||
os.remove(f"{thought.uuid}.m4a") # Remove the original file
|
||||
os.remove(os.path.join(settings.MEDIA_ROOT, f"{thought.uuid}.m4a")) # Remove the original file
|
||||
thought.media.name = f"{thought.uuid}.aac" # Update the file in the DB
|
||||
|
||||
thought.save()
|
||||
|
|
Loading…
Reference in New Issue