Enabled move and queue processing

This commit is contained in:
Deon George
2016-06-29 14:04:02 +10:00
parent 4c317a811c
commit 3361427c75
8 changed files with 201 additions and 92 deletions

View File

@@ -9,13 +9,9 @@ use App\Model\PhotoPerson;
use App\Model\Photo;
use App\Model\PhotoTag;
use App\Model\Tag;
use Illuminate\Foundation\Bus\DispatchesJobs;
use App\Jobs\PhotoMove;
class Import extends Command
{
use DispatchesJobs;
/**
* The name and signature of the console command.
*
@@ -77,7 +73,7 @@ class Import extends Command
}
// Determine if our dir is releative to where we store data
$dir = preg_replace('/^\//','',str_replace(config('photo.dir'),'',$dir));
$dir = Photo::path($dir);
// Add our path
if ($dir)
@@ -150,8 +146,8 @@ class Import extends Command
$po->width = $po->io()->getImageWidth();
$po->orientation = $po->io()->getImageOrientation();
$po->gps_lat = $po->latlon(preg_split('/,\s?/',$po->io()->getImageProperty('exif:GPSLatitude')),$po->io()->getImageProperty('exif:GPSLatitudeRef'));
$po->gps_lon = $po->latlon(preg_split('/,\s?/',$po->io()->getImageProperty('exif:GPSLongitude')),$po->io()->getImageProperty('exif:GPSLongitudeRef'));
$po->gps_lat = Photo::latlon(preg_split('/,\s?/',$po->io()->getImageProperty('exif:GPSLatitude')),$po->io()->getImageProperty('exif:GPSLatitudeRef'));
$po->gps_lon = Photo::latlon(preg_split('/,\s?/',$po->io()->getImageProperty('exif:GPSLongitude')),$po->io()->getImageProperty('exif:GPSLongitudeRef'));
try {
$po->thumbnail = exif_thumbnail($po->file_path());
@@ -218,8 +214,6 @@ class Import extends Command
$x->photo_id = $po->id;
$x->save();
}
$this->dispatch((new PhotoMove($po))->onQueue('move'));
}
$bar->finish();