From 1e96b129006acfcc7fa32b5be1aec53dd49d15b9 Mon Sep 17 00:00:00 2001 From: nonmakina Date: Mon, 4 Jan 2021 17:42:57 -0600 Subject: [PATCH 1/2] Adds spoilers to api --- inc/api.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/inc/api.php b/inc/api.php index 0ebaaf22..9df37e8c 100644 --- a/inc/api.php +++ b/inc/api.php @@ -93,6 +93,9 @@ class Api { $dotPos = strrpos($file->file, '.'); $apiPost['ext'] = substr($file->file, $dotPos); $apiPost['tim'] = substr($file->file, 0, $dotPos); + if (isset ($file->thumb) && $file->thumb) { + $apiPost['spoiler'] = $file->thumb === 'spoiler' ? 1 : 0; + } if (isset ($file->hash) && $file->hash) { $apiPost['md5'] = base64_encode(hex2bin($file->hash)); } From 6aa316138028f9febef34f77403e3d5d3848e433 Mon Sep 17 00:00:00 2001 From: nonmakina Date: Mon, 4 Jan 2021 17:46:50 -0600 Subject: [PATCH 2/2] Fixes indenting --- inc/api.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/inc/api.php b/inc/api.php index 9df37e8c..86d1f856 100644 --- a/inc/api.php +++ b/inc/api.php @@ -93,9 +93,9 @@ class Api { $dotPos = strrpos($file->file, '.'); $apiPost['ext'] = substr($file->file, $dotPos); $apiPost['tim'] = substr($file->file, 0, $dotPos); - if (isset ($file->thumb) && $file->thumb) { - $apiPost['spoiler'] = $file->thumb === 'spoiler' ? 1 : 0; - } + if (isset ($file->thumb) && $file->thumb) { + $apiPost['spoiler'] = $file->thumb === 'spoiler' ? 1 : 0; + } if (isset ($file->hash) && $file->hash) { $apiPost['md5'] = base64_encode(hex2bin($file->hash)); }