Photos and album contents are now physically deleted from disk
This commit is contained in:
@@ -118,6 +118,25 @@ class PhotoService
|
||||
$this->regenerateThumbnails($originalPhotoResource);
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
// Remove all thumbnails first - so if any fail, we don't delete the original
|
||||
$themeInfo = $this->themeHelper->info();
|
||||
$thumbnailsRequired = $themeInfo['thumbnails'];
|
||||
|
||||
/** @var mixed $thumbnail */
|
||||
foreach ($thumbnailsRequired as $thumbnail)
|
||||
{
|
||||
$this->albumSource->deleteThumbnail($this->photo, $thumbnail['name']);
|
||||
}
|
||||
|
||||
// Next remove the original photo
|
||||
$this->albumSource->deleteThumbnail($this->photo);
|
||||
|
||||
// Finally remove the database record
|
||||
$this->photo->delete();
|
||||
}
|
||||
|
||||
public function regenerateThumbnails($originalPhotoResource = null)
|
||||
{
|
||||
if (is_null($originalPhotoResource))
|
||||
|
||||
Reference in New Issue
Block a user