From 5599e170a79a59c3bfcebe09a4048ee440207e05 Mon Sep 17 00:00:00 2001 From: Matthias Guillitte Date: Wed, 4 Jun 2025 14:34:36 +0200 Subject: [PATCH] Fix debug screenshot --- app/Browser/JobDebugScreenshot.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Browser/JobDebugScreenshot.php b/app/Browser/JobDebugScreenshot.php index cc28557..3a3ac98 100644 --- a/app/Browser/JobDebugScreenshot.php +++ b/app/Browser/JobDebugScreenshot.php @@ -9,19 +9,19 @@ use function rtrim; class JobDebugScreenshot { public const IMG_FILE_NAME = "debug-"; - public static function getFileName(int $jobId): string { - return static::IMG_FILE_NAME . $jobId . ".png"; + public static function getFileName(int $jobId, bool $withExtension = false): string { + return static::IMG_FILE_NAME . $jobId . ($withExtension ? ".png": ""); } public static function getImgFileAbsolutePath(int $jobId): string { - return rtrim(Browser::$storeScreenshotsAt, '/') . "/" . static::getFileName($jobId); + return rtrim(Browser::$storeScreenshotsAt, '/') . "/" . static::getFileName($jobId, true); } public static function getImgFileProjectPath(int $jobId): string { - return app_path("Browser/screenshots/" . static::getFileName($jobId)); + return app_path("Browser/screenshots/" . static::getFileName($jobId, true)); } public static function getImgFileExternalPath(int $jobId): string { - return "screenshots/" . static::getFileName($jobId); + return "screenshots/" . static::getFileName($jobId, true); } }