Browse Source

add some stuff to the api, to match vichan's api at the request of a user. fixed the delete-stray-images script

pull/76/head
Your Name 2 years ago
parent
commit
188f961f7c
  1. 3
      inc/api.php
  2. 4
      tools/delete-stray-images.php

3
inc/api.php

@ -95,6 +95,9 @@ class Api {
$this->translateFields($this->fileFields, $file, $apiPost);
$apiPost['filename'] = @substr($file->name, 0, strrpos($file->name, '.'));
$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';
}

4
tools/delete-stray-images.php

@ -23,10 +23,10 @@ foreach ($boards as $board) {
$valid_thumb = array();
while ($post = $query->fetch(PDO::FETCH_ASSOC)) {
$files = json_decode($post['files']);
$files = json_decode($post['files']);
foreach ($files as $i => $f) {
if ($f->file != 'deleted' && $f->file != 'spoiler' && $f->file != 'file'){
$valid_src[] = $f->filename;
$valid_src[] = $f->file;
$valid_thumb[] = $f->thumb;
}
}

Loading…
Cancel
Save