From 4b9fd944985c04017f649f6e3c376cfc3d960b2c Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 18 Apr 2022 14:44:08 +0100 Subject: [PATCH] Support for flac audio format --- media.py | 1 + outbox.py | 1 + webapp_media.py | 7 ++++++- webapp_podcast.py | 2 ++ webapp_utils.py | 2 ++ 5 files changed, 12 insertions(+), 1 deletion(-) diff --git a/media.py b/media.py index 962192824..1f84f7a10 100644 --- a/media.py +++ b/media.py @@ -416,6 +416,7 @@ def path_is_audio(path: str) -> bool: """ if path.endswith('.ogg') or \ path.endswith('.opus') or \ + path.endswith('.flac') or \ path.endswith('.mp3'): return True return False diff --git a/outbox.py b/outbox.py index 03b7d74b6..055d01933 100644 --- a/outbox.py +++ b/outbox.py @@ -313,6 +313,7 @@ def post_message_to_outbox(session, translate: {}, "avif": "avif", "audio/mpeg": "mp3", "ogg": "ogg", + "flac": "flac", "opus": "opus", "mp4": "mp4", "webm": "webm", diff --git a/webapp_media.py b/webapp_media.py index 082dc53c4..7ddedb862 100644 --- a/webapp_media.py +++ b/webapp_media.py @@ -227,7 +227,10 @@ def _add_embedded_video_from_sites(translate: {}, content: str, def _add_embedded_audio(translate: {}, content: str) -> str: """Adds embedded audio for mp3/ogg/opus """ - if not ('.mp3' in content or '.ogg' in content or '.opus' in content): + if not ('.mp3' in content or + '.ogg' in content or + '.opus' in content or + '.flac' in content): return content if '