Move video over to software_id

This commit is contained in:
Deon George
2019-12-26 15:56:31 +11:00
parent 99ca07201e
commit 80a76559e5
8 changed files with 148 additions and 22 deletions

View File

@@ -20,11 +20,6 @@ class Photo extends Abstracted\Catalog
8=>-90,
];
public function software()
{
return $this->belongsTo(Software::class);
}
public function getIDLinkAttribute()
{
return $this->HTMLLinkAttribute($this->id,url('p/info').'/');
@@ -184,12 +179,23 @@ class Photo extends Abstracted\Catalog
$this->gps_lon = static::latlon(preg_split('/,\s?/',$this->property('exif:GPSLongitude')),$this->property('exif:GPSLongitudeRef'));
}
// @todo Now set software_id
public function setMakeModel()
{
$this->make = $this->property('exif:Make') ? $this->property('exif:Make') : NULL;
$this->model = $this->property('exif:Model') ? $this->property('exif:Model') : NULL;
$this->software = $this->property('exif:Software') ? $this->property('exif:Software') : NULL;
$ma = Make::firstOrCreate([
'name'=>$this->property('exif:Make') ?: NULL,
]);
$mo = Model::firstOrCreate([
'name'=>$this->property('exif:Model') ?: NULL,
'make_id'=>$ma->id,
]);
$so = Software::firstOrCreate([
'name'=>$this->property('exif:Software') ?: NULL,
'model_id'=>$mo->id,
]);
$this->software_id = $so->id;
}
public function setSignature()