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

@@ -141,12 +141,24 @@ class Video extends Abstracted\Catalog
$this->gps_altitude = $this->property('gps_altitude');
}
// @todo Now set software_id
public function setMakeModel()
{
$this->make = $this->property('make');
$this->model = $this->property('model');
$this->software = $this->property('software');
$ma = Make::firstOrCreate([
'name'=>$this->property('make') ?: NULL,
]);
$mo = Model::firstOrCreate([
'name'=>$this->property('model') ?: NULL,
'make_id'=>$ma->id,
]);
$so = Software::firstOrCreate([
'name'=>$this->property('software') ?: NULL,
'model_id'=>$mo->id,
]);
$this->software_id = $so->id;
$this->type = $this->property('type');
$this->length = round($this->property('length'),2);
$this->codec = $this->property('codec');