aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-08-22 18:29:51 -0700
committerzotlabs <mike@macgirvin.com>2017-08-22 18:29:51 -0700
commit9f37dbc6dc1798b9b56a683ed1975adc318ff931 (patch)
treed64c789016058cde0fd1ecbb9a0a23bd81b5119a /include
parent33528c616ae976891df7a778ce9360ceb56571f4 (diff)
downloadvolse-hubzilla-9f37dbc6dc1798b9b56a683ed1975adc318ff931.tar.gz
volse-hubzilla-9f37dbc6dc1798b9b56a683ed1975adc318ff931.tar.bz2
volse-hubzilla-9f37dbc6dc1798b9b56a683ed1975adc318ff931.zip
util/dcp - support recursion and folders full of photos by importing files singly in separate processes - not yet tested
Diffstat (limited to 'include')
-rw-r--r--include/attach.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/attach.php b/include/attach.php
index 79a38590b..78e133b03 100644
--- a/include/attach.php
+++ b/include/attach.php
@@ -460,6 +460,7 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
// By default remove $src when finished
$remove_when_processed = true;
+ $import_replace = false;
if($options === 'import') {
$src = $arr['src'];
@@ -476,6 +477,9 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
if($arr['preserve_original'])
$remove_when_processed = false;
+ if($arr['replace'])
+ $import_replace = true;
+
// if importing a directory, just do it now and go home - we're done.
if(array_key_exists('is_dir',$arr) && intval($arr['is_dir'])) {
@@ -617,8 +621,10 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
dbesc($folder_hash)
);
if($r) {
- $overwrite = get_pconfig($channel_id,'system','overwrite_dup_files');
+ $overwrite = (($import_replace || get_pconfig($channel_id,'system','overwrite_dup_files')) ? true : false);
if(($overwrite) || ($options === 'import')) {
+ if(! array_key_exists('edited',$arr))
+ $arr['edited'] = datetime_convert();
$options = 'replace';
$existing_id = $x[0]['id'];
$existing_size = intval($x[0]['filesize']);