diff --git a/app/methods/hosted_file_methods.py b/app/methods/hosted_file_methods.py index 5c777bb..e5c4031 100644 --- a/app/methods/hosted_file_methods.py +++ b/app/methods/hosted_file_methods.py @@ -670,7 +670,7 @@ def handle_delete_hosted_file( # hosted_files_path = '/home/scott/tmp/hosted_files_dev/' log.info(f'Hosted Files Path: {hosted_files_path}') - dir_path = hosted_file_obj.directory_path + # dir_path = hosted_file_obj.directory_path subdir_path = hosted_file_obj.subdirectory_path hash_sha256 = hosted_file_obj.hash_sha256 hash_filename = hash_sha256+'.file' diff --git a/app/routers/event_file.py b/app/routers/event_file.py index 84d7786..e170c20 100644 --- a/app/routers/event_file.py +++ b/app/routers/event_file.py @@ -269,7 +269,7 @@ async def download_event_file( if not filename: filename = event_file_obj.filename log.info(f'Filename: {filename}') - dir_path = event_file_obj.hosted_file.directory_path + # dir_path = event_file_obj.hosted_file.directory_path subdir_path = event_file_obj.hosted_file.subdirectory_path hash_sha256 = event_file_obj.hosted_file.hash_sha256 if not hash_sha256: diff --git a/app/routers/hosted_file.py b/app/routers/hosted_file.py index 0ff25f3..ad6ae37 100644 --- a/app/routers/hosted_file.py +++ b/app/routers/hosted_file.py @@ -192,7 +192,7 @@ async def download_hosted_file( if not filename: filename = hosted_file_obj.filename log.info(f'Filename: {filename}') - dir_path = hosted_file_obj.directory_path + # dir_path = hosted_file_obj.directory_path subdir_path = hosted_file_obj.subdirectory_path hash_sha256 = hosted_file_obj.hash_sha256 hash_filename = hash_sha256+'.file' @@ -281,7 +281,7 @@ async def stream_hosted_file( if not filename: filename = hosted_file_obj.filename log.info(f'Filename: {filename}') - dir_path = hosted_file_obj.directory_path + # dir_path = hosted_file_obj.directory_path subdir_path = hosted_file_obj.subdirectory_path hash_sha256 = hosted_file_obj.hash_sha256 hash_filename = hash_sha256+'.file' @@ -1250,7 +1250,7 @@ def run_ffmpeg(cmd): except subprocess.CalledProcessError as e: log.exception('Error running ffmpeg command') return {'success': False, 'status_message': f'Error running ffmpeg command: {e}'} - + return True @@ -1302,7 +1302,7 @@ async def create_video( title_image_path = title_image_opened.name with Image(width=1280, height=720, background='lightblue') as img: img.save(filename=title_image_path) - + with Image(filename=title_image_path) as img: with Drawing() as ctx: ctx.font_family = 'DejaVu Sans' # DejaVu Sans, DejaVu Sans Mono, DejaVu Serif @@ -1324,7 +1324,7 @@ async def create_video( ctx(img) img.save(filename=title_image_path) - + cmd = f"ls -lha /tmp" args = shlex.split(cmd) try: @@ -1336,7 +1336,7 @@ async def create_video( # Run the ffmpeg command to create a video file with the audio file and static image log.info('Run the ffmpeg command to create a video file with the audio file and static image') - + with tempfile.NamedTemporaryFile(delete=False, suffix='.mp4') as video_file: video_name = video_file.name # NOTE: It seems very important that the -y argument is used with ffmpeg run by subprocess.run(). Otherwise the process will hang. @@ -1346,7 +1346,7 @@ async def create_video( # cmd = f"ffmpeg -hide_banner -i {audio_file_path} -c:a aac {video_name}" log.debug(cmd) - # Run the ffmpeg command + # Run the ffmpeg command args = shlex.split(cmd) try: result = subprocess.run(args, check=True, capture_output=True, text=True) @@ -1391,7 +1391,7 @@ async def clip_video( # Run the ffmpeg command to clip a video file based on the start and end times given log.info('Run the ffmpeg command to clip a video file based on the start and end times given') - + with tempfile.NamedTemporaryFile(delete=False, suffix='.mp4') as tmp_video_file_clip: tmp_video_file_clip_path = tmp_video_file_clip.name @@ -1410,7 +1410,7 @@ async def clip_video( log.debug(cmd) - # Run the ffmpeg command + # Run the ffmpeg command args = shlex.split(cmd) try: result = subprocess.run(args, check=True, capture_output=True, text=True)