merge-requests/30/head
Bob Mottram 2024-02-05 12:49:36 +00:00
parent 50fdb97cf0
commit 315f404ee3
1 changed files with 8 additions and 10 deletions

View File

@ -703,9 +703,10 @@ def archive_media(base_dir: str, archive_directory: str,
def path_is_video(path: str) -> bool:
"""Is the given path a video file?
"""
if path.endswith('.ogv') or \
path.endswith('.mp4'):
return True
extensions = get_video_extensions()
for ext in extensions:
if path.endswith('.' + ext):
return True
return False
@ -720,13 +721,10 @@ def path_is_transcript(path: str) -> bool:
def path_is_audio(path: str) -> bool:
"""Is the given path an audio file?
"""
if path.endswith('.ogg') or \
path.endswith('.opus') or \
path.endswith('.spx') or \
path.endswith('.flac') or \
path.endswith('.wav') or \
path.endswith('.mp3'):
return True
extensions = get_audio_extensions()
for ext in extensions:
if path.endswith('.' + ext):
return True
return False