Fixes #272 missing md5sum

* dashboard: add warning if missing checksums
* add a "compute all missing md5sum" option in batch manager (inspired by delete orphans)
* progress bar when computing md5sums
This commit is contained in:
Teatek
2019-01-22 10:26:52 +01:00
committed by Pierrick Le Gall
parent 29f938acba
commit b05241f508
10 changed files with 206 additions and 4 deletions
+24
View File
@@ -1807,6 +1807,30 @@ function ws_images_checkUpload($params, $service)
return $ret;
}
/**
* API method
* add md5sum at photos, by block. Returns how md5sum were added and how many are remaining.
* @param mixed[] $params
* @option int block_size
*/
function ws_images_setMd5sum($params, $service)
{
if (get_pwg_token() != $params['pwg_token'])
{
return new PwgError(403, 'Invalid security token');
}
include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
$md5sum_ids_to_add = array_slice(get_photos_no_md5sum(), 0, $params['block_size']);
$added_count = add_md5sum($md5sum_ids_to_add);
return array(
'nb_added' => $added_count,
'nb_no_md5sum' => count(get_photos_no_md5sum()),
);
}
/**
* API method
* Deletes orphan photos, by block. Returns how many orphans were deleted and how many are remaining.