From ec4c7ae3d131cac94a68712b2b05253eed77544e Mon Sep 17 00:00:00 2001 From: Deon George Date: Fri, 1 Jul 2016 15:59:22 +1000 Subject: [PATCH] Some minor fixes --- app/Console/Commands/Import.php | 12 +++++++----- app/Console/Commands/Move.php | 2 +- resources/views/photo/deletereview.blade.php | 4 ++++ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/app/Console/Commands/Import.php b/app/Console/Commands/Import.php index 1532a72..e677fae 100644 --- a/app/Console/Commands/Import.php +++ b/app/Console/Commands/Import.php @@ -66,14 +66,14 @@ class Import extends Command if ($this->option('tags')) { $tags = explode(',',$this->option('tags')); - $t = Tag::whereIn('tag',$tags)->pluck('id'); + $t = Tag::whereIn('tag',$tags)->pluck('id')->toArray(); } // People if ($this->option('people')) { $tags = explode(',',$this->option('people')); - $p = Person::whereIn('tag',$tags)->pluck('id'); + $p = Person::whereIn('tag',$tags)->pluck('id')->toArray(); } $c = 0; @@ -106,7 +106,7 @@ class Import extends Command $po->filename = $file; } - $po->date_taken = strtotime($po->property('exif:DateTime')); + $po->date_taken = strtotime($po->property('exif:DateTime') ? $po->property('exif:DateTime') : $po->property('exif:DateTimeOriginal')); $po->subsectime = $po->property('exif:SubSecTimeOriginal'); $po->signature = $po->property('signature'); @@ -168,8 +168,10 @@ class Import extends Command $this->info(sprintf('Image [%s] stored in DB: %s',$file,$po->id)); // Record our people and tags - $po->People()->sync($p->toArray()); - $po->Tags()->sync($t->toArray()); + if ($p) + $po->People()->sync($p); + if ($t) + $po->Tags()->sync($t); } $bar->finish(); diff --git a/app/Console/Commands/Move.php b/app/Console/Commands/Move.php index 55bd7d2..7ce8456 100644 --- a/app/Console/Commands/Move.php +++ b/app/Console/Commands/Move.php @@ -50,7 +50,7 @@ class Move extends Command } elseif ($this->option('id')) { - $po = Photo::notRemove()->notDuplicate()->where('id',Photo::path($this->option('id'))); + $po = Photo::notRemove()->notDuplicate()->where('id',$this->option('id')); } else { diff --git a/resources/views/photo/deletereview.blade.php b/resources/views/photo/deletereview.blade.php index 2208a50..9ea2696 100644 --- a/resources/views/photo/deletereview.blade.php +++ b/resources/views/photo/deletereview.blade.php @@ -31,6 +31,7 @@
{{ $photos->links() }}
+@if ($photos->count())
@foreach ($data as $k=>$v) @@ -66,6 +67,9 @@ endswitch ?> {{ csrf_field() }} +@else + NONE! +@endif