From 72376532b32395eda04dc032c07ca08b27346c6b Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Fri, 28 Mar 2025 01:29:49 +0700 Subject: [PATCH] misc: Minor improvements (#1866) * misc: Minor improvements * Update _cleanup.php * Update TorrServerAPI.php * Update TorrServerAPI.php --- _cleanup.php | 1 + src/TorrServerAPI.php | 17 +++++------------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/_cleanup.php b/_cleanup.php index 3b292c216..cbaf5deac 100644 --- a/_cleanup.php +++ b/_cleanup.php @@ -18,6 +18,7 @@ if (php_sapi_name() !== 'cli') { $items = [ '.github', + '.cliffignore', '.editorconfig', '.gitignore', '.styleci.yml', diff --git a/src/TorrServerAPI.php b/src/TorrServerAPI.php index 4fdfb6e14..3764c56e6 100644 --- a/src/TorrServerAPI.php +++ b/src/TorrServerAPI.php @@ -47,13 +47,6 @@ class TorrServerAPI 'extension' => '.m3u' ]; - /** - * Log filename - * - * @var string - */ - private string $logFile = 'torr_server'; - /** * TorrServer constructor */ @@ -92,7 +85,7 @@ class TorrServerAPI ]); $isSuccess = $curl->httpStatusCode === 200; if (!$isSuccess) { - bb_log("TorrServer (ERROR) [$this->url]: Response code: {$curl->httpStatusCode} | Content: {$curl->response}\n", $this->logFile); + bb_log("TorrServer (ERROR) [$this->url]: Response code: {$curl->httpStatusCode} | Content: {$curl->response}" . LOG_LF); } $curl->close(); @@ -147,7 +140,7 @@ class TorrServerAPI file_put_contents($m3uFile, $curl->response); } } else { - bb_log("TorrServer (ERROR) [$this->url]: Response code: {$curl->httpStatusCode} | Content: {$curl->response}\n", $this->logFile); + bb_log("TorrServer (ERROR) [$this->url]: Response code: {$curl->httpStatusCode} | Content: {$curl->response}" . LOG_LF); } $curl->close(); @@ -187,7 +180,7 @@ class TorrServerAPI if (unlink($m3uFile)) { return true; } else { - bb_log("TorrServer (ERROR) [removeM3U()]: Can't unlink file '$m3uFile'\n", $this->logFile); + bb_log("TorrServer (ERROR) [removeM3U()]: Can't unlink file '$m3uFile'" . LOG_LF); } } @@ -229,7 +222,7 @@ class TorrServerAPI if ($curl->httpStatusCode === 200 && !empty($response->{$index})) { CACHE('tr_cache')->set("ffprobe_m3u_$attach_id", $response, 3600); } else { - bb_log("TorrServer (ERROR) [$this->url]: Response code: {$curl->httpStatusCode}\n", $this->logFile); + bb_log("TorrServer (ERROR) [$this->url]: Response code: {$curl->httpStatusCode}" . LOG_LF); } $curl->close(); } @@ -254,7 +247,7 @@ class TorrServerAPI $curl->get($this->url . $this->endpoints['stream'], ['link' => $hash]); $isSuccess = $curl->httpStatusCode === 200; if (!$isSuccess) { - bb_log("TorrServer (ERROR) [$this->url]: Response code: {$curl->httpStatusCode} | Content: {$curl->response}\n", $this->logFile); + bb_log("TorrServer (ERROR) [$this->url]: Response code: {$curl->httpStatusCode} | Content: {$curl->response}" . LOG_LF); } $curl->close();