From 63a9a15e67e6b956b78b7c9369e505fe454970f4 Mon Sep 17 00:00:00 2001 From: ArabCoders Date: Thu, 27 Feb 2025 18:42:35 +0300 Subject: [PATCH] do not consider 0 byte files. --- app/library/Utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/library/Utils.py b/app/library/Utils.py index bad19221..45c26df1 100644 --- a/app/library/Utils.py +++ b/app/library/Utils.py @@ -545,6 +545,9 @@ def get_sidecar_subtitles(file: pathlib.Path) -> list[dict]: if f.suffix not in ALLOWED_SUBS_EXTENSIONS: continue + if f.stat().st_size < 1: + continue + lg = re.search(r"\.(?P\w{2,3})\.\w{3}$", f.name) lang = lg.groupdict().get("lang") if lg else "und"