Minor fixes

This commit is contained in:
Deon George
2019-12-27 13:32:42 +11:00
parent 8c453d7b0e
commit fe155525a3
6 changed files with 23 additions and 10 deletions

View File

@@ -181,13 +181,16 @@ class Photo extends Abstracted\Catalog
public function setMakeModel()
{
$ma = Make::firstOrCreate([
'name'=>$this->property('exif:Make') ?: NULL,
]);
$ma = NULL;
if ($this->property('exif:Make'))
$ma = Make::firstOrCreate([
'name'=>$this->property('exif:Make'),
]);
$mo = Model::firstOrCreate([
'name'=>$this->property('exif:Model') ?: NULL,
'make_id'=>$ma->id,
'make_id'=>$ma ? $ma->id : NULL,
]);
$so = Software::firstOrCreate([