th: factor out IMG_EXTS

This commit is contained in:
Ivan Shapovalov
2026-02-03 18:54:58 +01:00
committed by ed
parent b2711e05b6
commit 720c83b2ff

View File

@@ -20,6 +20,8 @@ if TYPE_CHECKING:
IOERROR = "reading the file was denied by the server os; either due to filesystem permissions, selinux, apparmor, or similar:\n%r"
IMG_EXTS = set(["webp", "jpg", "png"])
class ThumbCli(object):
def __init__(self, hsrv: "HttpSrv") -> None:
@@ -89,7 +91,7 @@ class ThumbCli(object):
preferred = self.args.th_dec[0] if self.args.th_dec else ""
if rem.startswith(".hist/th/") and rem.split(".")[-1] in ["webp", "jpg", "png"]:
if rem.startswith(".hist/th/") and rem.split(".")[-1] in IMG_EXTS:
return os.path.join(ptop, rem)
if fmt[:1] in "jw" and fmt != "wav":