feature 2533 added: ability to deactivate uniqueness check on pwg.images.add
git-svn-id: http://piwigo.org/svn/branches/2.3@12725 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
parent
5dca66c7d1
commit
df9bc84102
2 changed files with 15 additions and 11 deletions
|
@ -1634,6 +1634,8 @@ function ws_images_add($params, &$service)
|
|||
}
|
||||
|
||||
// does the image already exists ?
|
||||
if ($params['check_uniqueness'])
|
||||
{
|
||||
if ('md5sum' == $conf['uniqueness_mode'])
|
||||
{
|
||||
$where_clause = "md5sum = '".$params['original_sum']."'";
|
||||
|
@ -1653,6 +1655,7 @@ SELECT
|
|||
if ($counter != 0) {
|
||||
return new PwgError(500, 'file already exists');
|
||||
}
|
||||
}
|
||||
|
||||
if ($params['resize'])
|
||||
{
|
||||
|
|
1
ws.php
1
ws.php
|
@ -241,6 +241,7 @@ function ws_addDefaultMethods( $arr )
|
|||
'maxValue' => $conf['available_permission_levels']
|
||||
),
|
||||
'resize' => array('default' => false),
|
||||
'check_uniqueness' => array('default' => true),
|
||||
),
|
||||
'POST method only.
|
||||
<br><b>categories</b> is a string list "category_id[,rank];category_id[,rank]" The rank is optional and is equivalent to "auto" if not given.'
|
||||
|
|
Loading…
Reference in a new issue