From 5ccae93ec29a90faba88dc825d97e8a973fe1144 Mon Sep 17 00:00:00 2001 From: DariusIII Date: Tue, 18 Dec 2018 09:19:45 +0100 Subject: [PATCH] Update deleteSingle function in Releases class --- Blacklight/Releases.php | 15 +++++++++------ Changelog | 2 ++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Blacklight/Releases.php b/Blacklight/Releases.php index cc5b39254..05dbd4145 100755 --- a/Blacklight/Releases.php +++ b/Blacklight/Releases.php @@ -494,15 +494,18 @@ class Releases /** * Deletes a single release by GUID, and all the corresponding files. * - * @param array $identifiers ['g' => Release GUID(mandatory), 'id => ReleaseID(optional, pass false)] - * @param NZB $nzb - * @param ReleaseImage $releaseImage + * @param array $identifiers ['g' => Release GUID(mandatory), 'id => ReleaseID(optional, pass + * false)] + * @param \Blacklight\NZB $nzb + * @param \Blacklight\ReleaseImage $releaseImage + * + * @throws \Exception */ - public function deleteSingle($identifiers, $nzb, $releaseImage): void + public function deleteSingle($identifiers, NZB $nzb, ReleaseImage $releaseImage): void { // Delete NZB from disk. $nzbPath = $nzb->NZBPath($identifiers['g']); - if ($nzbPath) { + if (! empty($nzbPath)) { File::delete($nzbPath); } @@ -513,7 +516,7 @@ class Releases $this->sphinxSearch->deleteRelease($identifiers); // Delete from DB. - Release::query()->where('guid', $identifiers['g'])->delete(); + Release::whereGuid($identifiers['g'])->delete(); } /** diff --git a/Changelog b/Changelog index 2336c2de4..9ba66d529 100755 --- a/Changelog +++ b/Changelog @@ -1,3 +1,5 @@ +2018-12-18 DariusIII + * Chg: Update deleteSingle function in Releases class 2018-12-17 DariusIII * Chg: Update ProcessReleases and Releases classes in an attempt to fix deletion of unwanted releases * Chg: Update package.json and tinymce to version 4.9.2