Enable some disabled functions
This commit is contained in:
parent
2e222b814b
commit
948e8ce9fc
@ -49,14 +49,13 @@ class CatalogAutoDelete extends Command
|
||||
$class = $this->getModelType($this->argument('type'));
|
||||
|
||||
$class::where('remove',1)->each(function($o) {
|
||||
foreach ($o->myduplicates() as $oo) {
|
||||
foreach ($o->myduplicates()->get() as $oo) {
|
||||
if (! $oo->signature OR ! $oo->file_signature)
|
||||
continue;
|
||||
|
||||
if ($oo->signature == $o->signature AND $oo->file_signature == $o->file_signature) {
|
||||
$this->info(sprintf('Removing: %s (%s)',$o->id,$o->filename));
|
||||
|
||||
continue;
|
||||
// Dispatch Job to move file.
|
||||
switch (strtolower($this->argument('type'))) {
|
||||
case 'photo':
|
||||
|
@ -13,7 +13,7 @@ use App\Models\{Person,Software,Tag};
|
||||
abstract class Catalog extends Model
|
||||
{
|
||||
protected static $includeSubSecTime = FALSE;
|
||||
protected $dates = ['created'];
|
||||
protected $dates = ['created','created_manual'];
|
||||
|
||||
protected $casts = [
|
||||
'subsectime' => 'int',
|
||||
@ -256,7 +256,7 @@ abstract class Catalog extends Model
|
||||
$file = $this->filename;
|
||||
|
||||
if ($new)
|
||||
$file = $this->file_name(FALSE);
|
||||
$file = $this->file_name(TRUE);
|
||||
|
||||
return (($short OR preg_match('/^\//',$file)) ? '' : config($this->type.'.dir').DIRECTORY_SEPARATOR).$file;
|
||||
}
|
||||
|
@ -8,7 +8,6 @@ class Video extends Abstracted\Catalog
|
||||
{
|
||||
// ID3 Object
|
||||
private $_o = NULL;
|
||||
protected $dates = ['created','created_manual'];
|
||||
|
||||
public function getIDLinkAttribute()
|
||||
{
|
||||
|
@ -2,11 +2,11 @@
|
||||
|
||||
namespace App\Traits;
|
||||
|
||||
use App\Jobs\PhotoDelete;
|
||||
use App\Models\Photo;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
use App\Jobs\{PhotoDelete,VideoDelete};
|
||||
|
||||
/**
|
||||
* Multimedia Controller Functions
|
||||
*
|
||||
@ -65,6 +65,21 @@ trait Multimedia
|
||||
if ($delete AND $o->remove AND ($request->input('remove.'.$id) ? 1 : NULL)) {
|
||||
Log::info(sprintf('Dispatching delete for [%s]',$o->id));
|
||||
|
||||
switch ($class) {
|
||||
case 'photo':
|
||||
$this->dispatch((new PhotoDelete($o))->onQueue('delete'));
|
||||
Log::info(sprintf('Dispatching delete for [%s]',$o->id));
|
||||
break;
|
||||
|
||||
case 'video':
|
||||
$this->dispatch((new VideoDelete($o))->onQueue('delete'));
|
||||
Log::info(sprintf('Dispatching delete for [%s]',$o->id));
|
||||
break;
|
||||
|
||||
default:
|
||||
Log::info(sprintf('Ignoring delete for [%s] - not configured.',$o->id));
|
||||
}
|
||||
|
||||
} else {
|
||||
$o->remove = $request->input('remove.'.$id) ? 1 : NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user