Bug fix for old directory_path that is no longer used.

This commit is contained in:
Scott Idem
2024-02-28 18:25:56 -05:00
parent 3efc55676e
commit 5cafd35bda
3 changed files with 11 additions and 11 deletions

View File

@@ -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'

View File

@@ -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:

View File

@@ -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)