From 769b9b4ccd4f17b3c2ab36668e622fffa0efaebb Mon Sep 17 00:00:00 2001 From: Max Nuding Date: Sat, 24 May 2025 13:38:34 +0200 Subject: [PATCH] converted most TODOa to issues --- auth_callback.php | 1 - scripts/pictureViewer.js | 2 -- src/DB/BaseDB.php | 1 - src/Roastmonday.php | 9 +-------- 4 files changed, 1 insertion(+), 12 deletions(-) diff --git a/auth_callback.php b/auth_callback.php index b12948e..3cb549f 100644 --- a/auth_callback.php +++ b/auth_callback.php @@ -5,7 +5,6 @@ session_start(); require __DIR__ . '/vendor/autoload.php'; if (empty($_GET['code'])) { //Auth token received by pnut - // TODO: Handle auth errors die("Error authenticating, did not receive a code"); } diff --git a/scripts/pictureViewer.js b/scripts/pictureViewer.js index 759b942..8d36585 100644 --- a/scripts/pictureViewer.js +++ b/scripts/pictureViewer.js @@ -17,7 +17,6 @@ function formatDates() { function getPostTexts() { let boxes = document.querySelectorAll('.post-box'); - // TODO: Implement multiple fetches with one call boxes.forEach(function(el) { let id = el.querySelector('.post-meta-box').querySelector('span').innerText.replace('#',''); get('get_posttext.php?id='+id).then(function(response) { @@ -50,7 +49,6 @@ function getPostTexts() { function getUserDetails() { let boxes = document.querySelectorAll('.user-box'); - // TODO: Implement multiple fetches with one call boxes.forEach(function(el) { let userBox = el.querySelector('.username'); if (userBox == null) { diff --git a/src/DB/BaseDB.php b/src/DB/BaseDB.php index a4307de..0691c7d 100644 --- a/src/DB/BaseDB.php +++ b/src/DB/BaseDB.php @@ -13,7 +13,6 @@ class BaseDB protected static int $ERR_CONNECTION_LIMIT = 1062; protected static int $ERR_TIMEOUT = 2002; - //TODO: Implement a better system public static int $SUCCESS = 0; public static int $SKIPPED_DUPLICATE = 1; public static int $TRIED_INSERT_DUPLICATE = 2; diff --git a/src/Roastmonday.php b/src/Roastmonday.php index ae764a7..7b4a93a 100644 --- a/src/Roastmonday.php +++ b/src/Roastmonday.php @@ -30,9 +30,6 @@ class Roastmonday extends APnutI if (!is_dir($this->pics_root . $this->temp_pics_root)) { mkdir($this->pics_root . $this->temp_pics_root); } - // TODO: Clean up logger everywhere to use context - // TODO: move to logrotate - // TODO: Convert TODOs to issues $this->logger->info('Pics root ', ['path' => $this->pics_root]); $this->logger->info('Pics root realpath', ['path' => realpath($this->pics_root)]); $this->logger->info('Temp pics root', ['path' => $this->pics_root . $this->temp_pics_root]); @@ -40,7 +37,7 @@ class Roastmonday extends APnutI $db_logger = null; if ($this->logger instanceof \Monolog\Logger) { - $db_logger = ($this->logger)->withName('database'); + $db_logger = ($this->logger)->withName('RM_Database'); $this->logger->info("Setting up DB Logger"); } else { $this->logger->info("Logger is not a Monolog logger, can not clone for DB Logger"); @@ -54,7 +51,6 @@ class Roastmonday extends APnutI ); } - // TODO: Support more extensions protected function getExtension($ct) { $ext = 'jpg'; @@ -124,7 +120,6 @@ class Roastmonday extends APnutI $this->logger->error('Error connecting to pnut wiki'); return []; } - // TODO: Use \Dom\HTMLDocument $doc = new \DOMDocument(); $doc->loadHTML($html); if ($doc === false) { @@ -513,7 +508,6 @@ class Roastmonday extends APnutI $this->logger->info('Posting about theme avatar'); $post = null; try { - // TODO: Add photo as attachment to post as well $post = $this->createPost($posttext, is_nsfw: false, auto_crop: true); } catch (\Exception $e) { $this->logger->error($e->getMessage()); @@ -585,7 +579,6 @@ class Roastmonday extends APnutI $target_file_name = $theme . '/' . $target_file_name_without_theme; $target_file = $this->pics_root . $target_file_name; if (move_uploaded_file($avatar["tmp_name"], $target_file)) { - // TODO: Remove hardcoded path $resp['img'] = 'pics/' . $target_file_name; } else { $this->logger->error("Error saving uploaded avatar from post #{$post_id}. Post has no creator.");