Bug fix for old directory_path that is no longer used.
This commit is contained in:
@@ -670,7 +670,7 @@ def handle_delete_hosted_file(
|
|||||||
# hosted_files_path = '/home/scott/tmp/hosted_files_dev/'
|
# hosted_files_path = '/home/scott/tmp/hosted_files_dev/'
|
||||||
log.info(f'Hosted Files Path: {hosted_files_path}')
|
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
|
subdir_path = hosted_file_obj.subdirectory_path
|
||||||
hash_sha256 = hosted_file_obj.hash_sha256
|
hash_sha256 = hosted_file_obj.hash_sha256
|
||||||
hash_filename = hash_sha256+'.file'
|
hash_filename = hash_sha256+'.file'
|
||||||
|
|||||||
@@ -269,7 +269,7 @@ async def download_event_file(
|
|||||||
if not filename:
|
if not filename:
|
||||||
filename = event_file_obj.filename
|
filename = event_file_obj.filename
|
||||||
log.info(f'Filename: {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
|
subdir_path = event_file_obj.hosted_file.subdirectory_path
|
||||||
hash_sha256 = event_file_obj.hosted_file.hash_sha256
|
hash_sha256 = event_file_obj.hosted_file.hash_sha256
|
||||||
if not hash_sha256:
|
if not hash_sha256:
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ async def download_hosted_file(
|
|||||||
if not filename:
|
if not filename:
|
||||||
filename = hosted_file_obj.filename
|
filename = hosted_file_obj.filename
|
||||||
log.info(f'Filename: {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
|
subdir_path = hosted_file_obj.subdirectory_path
|
||||||
hash_sha256 = hosted_file_obj.hash_sha256
|
hash_sha256 = hosted_file_obj.hash_sha256
|
||||||
hash_filename = hash_sha256+'.file'
|
hash_filename = hash_sha256+'.file'
|
||||||
@@ -281,7 +281,7 @@ async def stream_hosted_file(
|
|||||||
if not filename:
|
if not filename:
|
||||||
filename = hosted_file_obj.filename
|
filename = hosted_file_obj.filename
|
||||||
log.info(f'Filename: {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
|
subdir_path = hosted_file_obj.subdirectory_path
|
||||||
hash_sha256 = hosted_file_obj.hash_sha256
|
hash_sha256 = hosted_file_obj.hash_sha256
|
||||||
hash_filename = hash_sha256+'.file'
|
hash_filename = hash_sha256+'.file'
|
||||||
@@ -1250,7 +1250,7 @@ def run_ffmpeg(cmd):
|
|||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
log.exception('Error running ffmpeg command')
|
log.exception('Error running ffmpeg command')
|
||||||
return {'success': False, 'status_message': f'Error running ffmpeg command: {e}'}
|
return {'success': False, 'status_message': f'Error running ffmpeg command: {e}'}
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
@@ -1302,7 +1302,7 @@ async def create_video(
|
|||||||
title_image_path = title_image_opened.name
|
title_image_path = title_image_opened.name
|
||||||
with Image(width=1280, height=720, background='lightblue') as img:
|
with Image(width=1280, height=720, background='lightblue') as img:
|
||||||
img.save(filename=title_image_path)
|
img.save(filename=title_image_path)
|
||||||
|
|
||||||
with Image(filename=title_image_path) as img:
|
with Image(filename=title_image_path) as img:
|
||||||
with Drawing() as ctx:
|
with Drawing() as ctx:
|
||||||
ctx.font_family = 'DejaVu Sans' # DejaVu Sans, DejaVu Sans Mono, DejaVu Serif
|
ctx.font_family = 'DejaVu Sans' # DejaVu Sans, DejaVu Sans Mono, DejaVu Serif
|
||||||
@@ -1324,7 +1324,7 @@ async def create_video(
|
|||||||
ctx(img)
|
ctx(img)
|
||||||
|
|
||||||
img.save(filename=title_image_path)
|
img.save(filename=title_image_path)
|
||||||
|
|
||||||
cmd = f"ls -lha /tmp"
|
cmd = f"ls -lha /tmp"
|
||||||
args = shlex.split(cmd)
|
args = shlex.split(cmd)
|
||||||
try:
|
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
|
# 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')
|
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:
|
with tempfile.NamedTemporaryFile(delete=False, suffix='.mp4') as video_file:
|
||||||
video_name = video_file.name
|
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.
|
# 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}"
|
# cmd = f"ffmpeg -hide_banner -i {audio_file_path} -c:a aac {video_name}"
|
||||||
log.debug(cmd)
|
log.debug(cmd)
|
||||||
|
|
||||||
# Run the ffmpeg command
|
# Run the ffmpeg command
|
||||||
args = shlex.split(cmd)
|
args = shlex.split(cmd)
|
||||||
try:
|
try:
|
||||||
result = subprocess.run(args, check=True, capture_output=True, text=True)
|
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
|
# 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')
|
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:
|
with tempfile.NamedTemporaryFile(delete=False, suffix='.mp4') as tmp_video_file_clip:
|
||||||
tmp_video_file_clip_path = tmp_video_file_clip.name
|
tmp_video_file_clip_path = tmp_video_file_clip.name
|
||||||
|
|
||||||
@@ -1410,7 +1410,7 @@ async def clip_video(
|
|||||||
|
|
||||||
log.debug(cmd)
|
log.debug(cmd)
|
||||||
|
|
||||||
# Run the ffmpeg command
|
# Run the ffmpeg command
|
||||||
args = shlex.split(cmd)
|
args = shlex.split(cmd)
|
||||||
try:
|
try:
|
||||||
result = subprocess.run(args, check=True, capture_output=True, text=True)
|
result = subprocess.run(args, check=True, capture_output=True, text=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user