diff --git a/app/Console/Commands/CatalogScan.php b/app/Console/Commands/CatalogScan.php index 5fa9dc8..ada08f5 100644 --- a/app/Console/Commands/CatalogScan.php +++ b/app/Console/Commands/CatalogScan.php @@ -58,24 +58,20 @@ class CatalogScan extends Command $break = FALSE; foreach ($x as $oo) { - // If this photo siganture matches another. - if ($o->signature == $oo->signature) + // And that photo is not marked as a duplicate + if (! $oo->duplicate) { - // And that photo is not marked as a duplicate - if (! $oo->duplicate) + $o->duplicate = '1'; + $this->warn(sprintf('Image [%s] marked as a duplicate',$o->file_path())); + + // If the file signature also matches, we'll mark it for deletion + if ($oo->file_signature AND $o->file_signature == $oo->file_signature) { - $o->duplicate = '1'; - $this->warn(sprintf('Image [%s] marked as a duplicate',$o->file_path())); - - // If the file signature also matches, we'll mark it for deletion - if ($oo->file_signature AND $o->file_signature == $oo->file_signature) - { - $this->warn(sprintf('Image [%s] marked for deletion',$o->file_path())); - $o->remove = '1'; - } - - break; + $this->warn(sprintf('Image [%s] marked for deletion',$o->file_path())); + $o->remove = '1'; } + + break; } } } diff --git a/app/Console/Commands/VideoMove.php b/app/Console/Commands/VideoMove.php index 57b34a1..8908dbc 100644 --- a/app/Console/Commands/VideoMove.php +++ b/app/Console/Commands/VideoMove.php @@ -102,8 +102,11 @@ class VideoMove extends Command } else { - if ($x > 0) + if ($x > 0) { $this->warn(sprintf('Unable to move (%s) [%s] to [%s], moveable returned (%s)',$o->id,$o->file_path(),$o->file_path(FALSE,TRUE),$x)); + if ($x == 1 AND $v = Video::where('filename',$o->file_path(TRUE,TRUE))->first()) + $this->warn(sprintf('File is id (%s) [%s]',$v->file_path(),$v->id)); + } } } diff --git a/app/Http/Controllers/PhotoController.php b/app/Http/Controllers/PhotoController.php index 5ef2f3b..a1b61a0 100644 --- a/app/Http/Controllers/PhotoController.php +++ b/app/Http/Controllers/PhotoController.php @@ -36,7 +36,7 @@ class PhotoController extends Controller public function deletes($id=NULL) { - return view('catalog.deletereview',['return'=>url('/p/deletes'),'catalog'=>is_null($id) ? Photo::where('remove',1)->paginate(50) : Photo::where('id',$id)]); + return view('catalog.deletereview',['return'=>url('/p/deletes'),'catalog'=>is_null($id) ? Photo::where('remove',1)->paginate(50) : Photo::where('id',$id)->paginate(1)]); } public function deletesUpdate(Request $request) @@ -54,12 +54,12 @@ class PhotoController extends Controller public function duplicates($id=NULL) { - return view('photo.duplicates',['photos'=>is_null($id) ? Photo::notRemove()->where('duplicate',1)->paginate(1) : Photo::where('id',$id)->paginate(1)]); + return view('catalog.duplicatereview',['return'=>url('/p/duplicates'),'catalog'=>is_null($id) ? Photo::notRemove()->where('duplicate',1)->paginate(50) : Photo::where('id',$id)->paginate(1)]); } public function duplicatesUpdate(Request $request) { - foreach ($request->input('photo') as $id) + foreach ($request->input('items') as $id) { $po = Photo::findOrFail($id); diff --git a/app/Http/Controllers/VideoController.php b/app/Http/Controllers/VideoController.php index ffdd4ed..1c48f36 100644 --- a/app/Http/Controllers/VideoController.php +++ b/app/Http/Controllers/VideoController.php @@ -37,7 +37,7 @@ class VideoController extends Controller public function deletes($id=NULL) { - return view('catalog.deletereview',['return'=>url('v/deletes'),'catalog'=>is_null($id) ? Video::where('remove',1)->paginate(10) : Video::where('id',$id)->paginate(1)]); + return view('catalog.deletereview',['return'=>url('v/deletes'),'catalog'=>is_null($id) ? Video::where('remove',1)->paginate(50) : Video::where('id',$id)->paginate(1)]); } public function deletesUpdate(Request $request) @@ -55,12 +55,12 @@ class VideoController extends Controller public function duplicates($id=NULL) { - return view('video.duplicates',['videos'=>is_null($id) ? Video::notRemove()->where('duplicate',1)->paginate(1) : Video::where('id',$id)->paginate(1)]); + return view('catalog.duplicatereview',['return'=>url('/v/duplicates'),'catalog'=>is_null($id) ? Video::notRemove()->where('duplicate',1)->paginate(50) : Video::where('id',$id)->paginate(1)]); } public function duplicatesUpdate(Request $request) { - foreach ($request->input('video') as $id) + foreach ($request->input('items') as $id) { $po = Video::findOrFail($id); diff --git a/app/Model/Abstracted/Catalog.php b/app/Model/Abstracted/Catalog.php index 44ae42a..fe45f25 100644 --- a/app/Model/Abstracted/Catalog.php +++ b/app/Model/Abstracted/Catalog.php @@ -156,6 +156,22 @@ abstract class Catalog extends Model return $this->TextTrueFalse($this->flag); } + /** + * Return item dimensions + */ + public function getDimensionsAttribute() + { + return $this->width.'x'.$this->height; + } + + /** + * Return HTML Checkbox for duplicate + */ + public function getDuplicateCheckboxAttribute() + { + return $this->HTMLCheckbox('duplicate',$this->id,$this->duplicate); + } + /** * Return HTML Checkbox for flagged */ diff --git a/resources/views/catalog/duplicatereview.blade.php b/resources/views/catalog/duplicatereview.blade.php new file mode 100644 index 0000000..ec2f90f --- /dev/null +++ b/resources/views/catalog/duplicatereview.blade.php @@ -0,0 +1,82 @@ +@extends('layouts.app') + +['id','idlink'], + 'Signature'=>['signature','signature'], + 'File Signature'=>['file_signature','file_signature'], + 'Date Created'=>['date_created','datecreatedtext'], + 'Filename'=>['filename','filename'], + 'Filesize'=>['filesize','filesize'], + 'Dimensions'=>['height','dimensions'], + 'Duplicate'=>['duplicate','duplicatecheckbox'], + 'Flagged'=>['flag','flagcheckbox'], + 'Delete'=>['remove','removecheckbox'], +];?> + +@section('content') +