From ae61c3dc35d2f42f5daca4bbc19e2e56074a909e Mon Sep 17 00:00:00 2001 From: DariusIII Date: Wed, 1 Mar 2023 14:39:15 +0100 Subject: [PATCH] Additional changes for tagging removal --- Blacklight/Categorize.php | 6 ++++- Blacklight/processing/ProcessReleases.php | 1 - Blacklight/processing/post/AniDB.php | 12 ++-------- .../Admin/AdminReleasesController.php | 3 +-- app/Models/Release.php | 24 +++++++++---------- 5 files changed, 20 insertions(+), 26 deletions(-) diff --git a/Blacklight/Categorize.php b/Blacklight/Categorize.php index c1ffe28d0..b10c3d98f 100755 --- a/Blacklight/Categorize.php +++ b/Blacklight/Categorize.php @@ -89,7 +89,7 @@ class Categorize return match (true) { $this->isMisc(), $this->byGroupName($this->groupName), $this->isPC(), $this->isXxx(), $this->isTV(), $this->isMovie(), $this->isConsole(), $this->isBook(), $this->isMusic() => [ - 'categories_id' => $this->tmpCat + 'categories_id' => $this->tmpCat, ], default => ['categories_id' => $this->tmpCat], }; @@ -488,6 +488,7 @@ class Categorize { if (preg_match('/web[._ -]dl|web-?rip/i', $this->releaseName)) { $this->tmpCat = Category::MOVIE_WEBDL; + return true; } @@ -784,6 +785,7 @@ class Categorize case preg_match('/(iPT\sTeam|KLEENEX)/i', $this->releaseName): case stripos($this->releaseName, 'SDPORN') !== false: $this->tmpCat = Category::XXX_CLIPSD; + return true; default: return false; @@ -895,6 +897,7 @@ class Categorize if (preg_match('/[^e]PS3/i', $this->releaseName)) { if (preg_match('/ANTiDOTE|DLC|DUPLEX|EUR?|Googlecus|GOTY|\-HR|iNSOMNi|JAP|JPN|KONDIOS|\[PS3\]|PSN/i', $this->releaseName)) { $this->tmpCat = Category::GAME_PS3; + return true; } if (preg_match('/AGENCY|APATHY|Caravan|MULTi|NRP|NTSC|PAL|SPLiT|STRiKE|USA?|ZRY/i', $this->releaseName)) { @@ -915,6 +918,7 @@ class Categorize if (preg_match('/[ \(_.-]PS4[ \)_.-]/i', $this->releaseName)) { if (preg_match('/ANTiDOTE|DLC|DUPLEX|EUR?|Googlecus|GOTY|\-HR|iNSOMNi|JAP|JPN|KONDIOS|\[PS4\]/i', $this->releaseName)) { $this->tmpCat = Category::GAME_PS4; + return true; } if (preg_match('/AGENCY|APATHY|Caravan|MULTi|NRP|NTSC|PAL|SPLiT|STRiKE|USA?|WaYsTeD|ZRY/i', $this->releaseName)) { diff --git a/Blacklight/processing/ProcessReleases.php b/Blacklight/processing/ProcessReleases.php index 73f0b2c59..3405a6951 100755 --- a/Blacklight/processing/ProcessReleases.php +++ b/Blacklight/processing/ProcessReleases.php @@ -21,7 +21,6 @@ use Blacklight\ReleaseImage; use Blacklight\Releases; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\DB; -use Illuminate\Support\Facades\Log; use Illuminate\Support\Str; use JetBrains\PhpStorm\ArrayShape; diff --git a/Blacklight/processing/post/AniDB.php b/Blacklight/processing/post/AniDB.php index 07cc5d0ee..0497c752e 100755 --- a/Blacklight/processing/post/AniDB.php +++ b/Blacklight/processing/post/AniDB.php @@ -4,6 +4,7 @@ namespace Blacklight\processing\post; use App\Models\AnidbEpisode; use App\Models\Category; +use App\Models\Release; use App\Models\Settings; use Blacklight\ColorCLI; use Blacklight\db\populate\AniDB as PaDb; @@ -284,16 +285,7 @@ class AniDB */ private function updateRelease($anidbId, $relId): void { - DB::update( - sprintf( - ' - UPDATE releases - SET anidbid = %d - WHERE id = %d', - $anidbId, - $relId - ) - ); + Release::update(['anidbid' => $anidbId])->where('id', $relId); } /** diff --git a/app/Http/Controllers/Admin/AdminReleasesController.php b/app/Http/Controllers/Admin/AdminReleasesController.php index 7ffdc9852..19ee22c68 100644 --- a/app/Http/Controllers/Admin/AdminReleasesController.php +++ b/app/Http/Controllers/Admin/AdminReleasesController.php @@ -59,8 +59,7 @@ class AdminReleasesController extends BasePageController $request->input('videos_id'), $request->input('tv_episodes_id'), $request->input('imdbid'), - $request->input('anidbid'), - $request->input('tagnames') + $request->input('anidbid') ); $release = Release::getByGuid($request->input('guid')); diff --git a/app/Models/Release.php b/app/Models/Release.php index aeae03b82..35c620413 100644 --- a/app/Models/Release.php +++ b/app/Models/Release.php @@ -312,20 +312,20 @@ class Release extends Model /** * Used for release edit page on site. * - * @param int $id - * @param string $name - * @param string $searchName - * @param string $fromName - * @param int $categoryId - * @param int $parts - * @param int $grabs - * @param int $size - * @param string $postedDate - * @param string $addedDate + * @param int $id + * @param string $name + * @param string $searchName + * @param string $fromName + * @param int $categoryId + * @param int $parts + * @param int $grabs + * @param int $size + * @param string $postedDate + * @param string $addedDate * @param $videoId * @param $episodeId - * @param int $imDbId - * @param int $aniDbId + * @param int $imDbId + * @param int $aniDbId * @param string $tags * * @throws \Exception