mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-07-06 01:42:29 +02:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user