From f71b8931e34729e0cca17195b574333c7f32620a Mon Sep 17 00:00:00 2001 From: JayZed Date: Mon, 26 Feb 2024 06:28:51 -0500 Subject: [PATCH] Fixed subtitles sync function to preserve subtitles file extension. #2399 --- bazarr/subtitles/tools/subsyncer.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bazarr/subtitles/tools/subsyncer.py b/bazarr/subtitles/tools/subsyncer.py index 79bb1b0eb..88f2812a3 100644 --- a/bazarr/subtitles/tools/subsyncer.py +++ b/bazarr/subtitles/tools/subsyncer.py @@ -35,7 +35,13 @@ class SubSyncer: no_fix_framerate=settings.subsync.no_fix_framerate, gss=settings.subsync.gss): self.reference = video_path self.srtin = srt_path - self.srtout = f'{os.path.splitext(self.srtin)[0]}.synced.srt' + if self.srtin.casefold().endswith('.ass'): + # try to preserve original subtitle style + # ffmpeg will be able to handle this automatically as long as it has the libass filter + extension = '.ass' + else: + extension = '.srt' + self.srtout = f'{os.path.splitext(self.srtin)[0]}.synced{extension}' self.args = None ffprobe_exe = get_binary('ffprobe')