From 2a81b3d569374d88c8102f0effd524ddc1ae87d8 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Sat, 17 Oct 2026 07:33:49 +0800 Subject: [PATCH] fix(types): narrow fpcalc executable boundary --- app/modules/acoustid/__init__.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/modules/acoustid/__init__.py b/app/modules/acoustid/__init__.py index e2ae3f44a..998e20e31 100644 --- a/app/modules/acoustid/__init__.py +++ b/app/modules/acoustid/__init__.py @@ -242,9 +242,12 @@ class AcoustIdModule(_ModuleBase): timeout = music_request_timeout(claim=False, maximum=self._fingerprint_timeout) if timeout is None: return None + fpcalc_path = self._fpcalc_path + if not fpcalc_path: + return None try: result = subprocess.run( - [self._fpcalc_path, "-json", str(path)], + [fpcalc_path, "-json", str(path)], capture_output=True, text=True, check=False, @@ -270,10 +273,13 @@ class AcoustIdModule(_ModuleBase): timeout = music_request_timeout(claim=False, maximum=self._fingerprint_timeout) if timeout is None: return None + fpcalc_path = self._fpcalc_path + if not fpcalc_path: + return None process = None try: process = await asyncio.create_subprocess_exec( - self._fpcalc_path, + fpcalc_path, "-json", str(path), stdout=asyncio.subprocess.PIPE,