Added Tagging, Moving with Replace, Optimised Delete

This commit is contained in:
Deon George
2015-07-12 21:23:57 +10:00
parent c88d289e82
commit 08f823460e
8 changed files with 272 additions and 52 deletions

View File

@@ -13,6 +13,8 @@ class Task_Photo_Move extends Minion_Task {
protected $_options = array(
'file'=>NULL, // Photo File to Move
'batch'=>NULL, // Number of photos to move in a batch
'useid'=>TRUE, // If date not in photo use ID
'verbose'=>FALSE, // Show some debuggig
);
protected function _execute(array $params) {
@@ -33,9 +35,12 @@ class Task_Photo_Move extends Minion_Task {
$c = 0;
foreach ($p->find_all() as $po) {
if ($po->file_path() == $po->file_path(FALSE,TRUE))
if ($po->file_path() == $po->file_path(FALSE,($params['useid'] OR $po->date_taken) ? TRUE : FALSE))
continue;
if ($params['verbose'])
printf("Processing [%s], file [%s] - newpath [%s]\n",$po->id,$po->file_path(),$po->file_path(FALSE,($params['useid'] OR $po->date_taken) ? TRUE : FALSE));
if ($po->move())
printf("Photo [%s] moved to %s.\n",$po->id,$po->file_path());
else