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

@ -45,8 +45,9 @@ class CatalogMove extends Command
continue;
}
$x = NULL;
if (! $o->scanned OR $o->duplicate OR $o->remove OR ($x=$o->moveable()) !== TRUE) {
$this->warn(sprintf('Ignoring [%s]...',$o->file_path()));
$this->warn(sprintf('Ignoring (%s)[%s]... [%s]',$o->id,$o->file_path(),$x));
continue;
}

View File

@ -48,7 +48,7 @@ class CatalogScan extends Command
$o->setThumbnail();
// If this is a duplicate
$x = $class::whereIN('id',$o->list_duplicate())->get();
$x = $o->duplicates()->get();
if (count($x)) {
foreach ($x as $oo) {
// And that photo is not marked as a duplicate

View File

@ -49,6 +49,11 @@ class VideoController extends Controller
if ($o->remove AND $request->input('remove.'.$id))
$this->dispatch((new VideoDelete($o))->onQueue('delete'));
elseif (! $o->remove) {
$o->remove = TRUE;
$o->save();
}
}
return redirect()->action('VideoController@deletes',$request->input('pagenext') ? '?page='.$request->input('pagenext') : NULL);

View File

@ -263,6 +263,7 @@ abstract class Catalog extends Model
/**
* Return the object type
* @return string
* @deprecated Use objecttype()
*/
public function getTypeAttribute(): string
{

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([

View File

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