Merge pull request #101 from nonmakina/spoilers

Adds spoilers to api
This commit is contained in:
towards-a-new-leftypol 2021-01-04 21:11:12 -05:00 committed by GitHub
commit 96b457af11

View File

@ -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));
}