From eafc4ea6b1ddefb1613c5a84f61c5f99213dbda3 Mon Sep 17 00:00:00 2001 From: DariusIII Date: Tue, 18 Dec 2018 11:03:02 +0100 Subject: [PATCH] Update PPA class --- .../processing/post/ProcessAdditional.php | 18 ++++++------------ Changelog | 1 + 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/Blacklight/processing/post/ProcessAdditional.php b/Blacklight/processing/post/ProcessAdditional.php index 054f1c03e..9cfab43e9 100755 --- a/Blacklight/processing/post/ProcessAdditional.php +++ b/Blacklight/processing/post/ProcessAdditional.php @@ -1579,7 +1579,7 @@ class ProcessAdditional // Get the amount of files we found inside the RAR/ZIP files. - $releaseFilesCount = ReleaseFile::query()->where('releases_id', $this->_release->id)->count('releases_id'); + $releaseFilesCount = ReleaseFile::whereReleasesId($this->_release->id)->count('releases_id'); if ($releaseFilesCount === null) { $releaseFilesCount = 0; @@ -1619,7 +1619,7 @@ class ProcessAdditional ); } - DB::update($query); + Release::fromQuery($query); } /** @@ -1674,13 +1674,7 @@ class ProcessAdditional $retVal = true; } - // Make sure the category is music or other. - $rQuery = DB::selectOne( - sprintf( - 'SELECT searchname, fromname, categories_id AS id, groups_id FROM releases WHERE proc_pp = 0 AND id = %d', - $this->_release->id - ) - ); + $rQuery = Release::query()->where('proc_pp', '=', 0)->where('id', $this->_release->id)->select(['searchname', 'fromname', 'categories_id'])->first(); $musicParent = (string) Category::MUSIC_ROOT; if ($rQuery === null || ! preg_match( @@ -1750,10 +1744,10 @@ class ProcessAdditional NameFixer::echoChangedReleaseName( [ 'new_name' => $newName, - 'old_name' => $rQuery['searchname'], + 'old_name' => $rQuery->searchname, 'new_category' => $newCat, - 'old_category' => $rQuery['id'], - 'group' => $rQuery['groups_id'], + 'old_category' => $rQuery->id, + 'group' => $rQuery->groups_id, 'releases_id' => $this->_release->id, 'method' => 'ProcessAdditional->_getAudioInfo', ] diff --git a/Changelog b/Changelog index 9ba66d529..ba72f96d2 100755 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ 2018-12-18 DariusIII + * Chg: Update PPA class * 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