From 65d7003fa63f9346692575d33e0ad71e812187df Mon Sep 17 00:00:00 2001 From: DariusIII Date: Sun, 3 Nov 2024 09:29:39 +0100 Subject: [PATCH] Update missed Settings model usage --- Blacklight/Binaries.php | 2 +- Blacklight/PopulateAniDB.php | 4 ++-- Blacklight/Tmux.php | 4 ++-- composer.lock | 12 ++++++------ misc/testing/NZB/nzb-reorg.php | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Blacklight/Binaries.php b/Blacklight/Binaries.php index 19ae3a7fe..d590a7345 100644 --- a/Blacklight/Binaries.php +++ b/Blacklight/Binaries.php @@ -247,7 +247,7 @@ class Binaries */ public function logIndexerStart(): void { - Settings::query()->where('setting', '=', 'last_run_time')->update(['value' => now()]); + Settings::query()->where('name', '=', 'last_run_time')->update(['value' => now()]); } /** diff --git a/Blacklight/PopulateAniDB.php b/Blacklight/PopulateAniDB.php index 5f94f2a8f..40426af01 100644 --- a/Blacklight/PopulateAniDB.php +++ b/Blacklight/PopulateAniDB.php @@ -104,7 +104,7 @@ class PopulateAniDB echo 'AniDB: Error getting response.'.PHP_EOL; } elseif (preg_match('/\Banned\<\/error\>/', $apiResponse)) { $this->banned = true; - Settings::query()->where(['section' => 'APIs', 'subsection' => 'AniDB', 'name' => 'banned'])->update(['value' => time()]); + Settings::query()->where(['name' => 'banned'])->update(['value' => time()]); } elseif (preg_match('/\Anime not found\<\/error\>/', $apiResponse)) { echo "AniDB : Anime not yet on site. Remove until next update.\n"; } elseif ($AniDBAPIXML = new \SimpleXMLElement($apiResponse)) { @@ -389,7 +389,7 @@ class PopulateAniDB */ private function setLastUpdated(): void { - Settings::query()->where(['section' => 'APIs', 'subsection' => 'AniDB', 'name' => 'last_full_update'])->update(['value' => time()]); + Settings::query()->where(['name' => 'last_full_update'])->update(['value' => time()]); } private function updateAniDBInfoEps($aniDbId, array $AniDBInfoArray = []): string diff --git a/Blacklight/Tmux.php b/Blacklight/Tmux.php index 911832fbd..c42e36a88 100755 --- a/Blacklight/Tmux.php +++ b/Blacklight/Tmux.php @@ -184,7 +184,7 @@ class Tmux public function updateItem($setting, $value): int { - return Settings::query()->where('setting', '=', $setting)->update(['value' => $value]); + return Settings::query()->where('name', '=', $setting)->update(['value' => $value]); } public function microtime_float(): float @@ -415,7 +415,7 @@ class Tmux public function startRunning(): void { if (! $this->isRunning()) { - Settings::query()->where(['section' => 'site', 'subsection' => 'tmux', 'setting' => 'running'])->update(['value' => 1]); + Settings::query()->where(['name' => 'running'])->update(['value' => 1]); } } diff --git a/composer.lock b/composer.lock index c70f7c4fe..c52dd6a26 100644 --- a/composer.lock +++ b/composer.lock @@ -15587,16 +15587,16 @@ }, { "name": "larastan/larastan", - "version": "v2.9.9", + "version": "v2.9.10", "source": { "type": "git", "url": "https://github.com/larastan/larastan.git", - "reference": "148faa138f0d8acb7d85f4a55693d3e13b6048d2" + "reference": "9e7233d88f4f10796fadb8a2d85c5f2b55277c76" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/larastan/larastan/zipball/148faa138f0d8acb7d85f4a55693d3e13b6048d2", - "reference": "148faa138f0d8acb7d85f4a55693d3e13b6048d2", + "url": "https://api.github.com/repos/larastan/larastan/zipball/9e7233d88f4f10796fadb8a2d85c5f2b55277c76", + "reference": "9e7233d88f4f10796fadb8a2d85c5f2b55277c76", "shasum": "" }, "require": { @@ -15666,7 +15666,7 @@ ], "support": { "issues": "https://github.com/larastan/larastan/issues", - "source": "https://github.com/larastan/larastan/tree/v2.9.9" + "source": "https://github.com/larastan/larastan/tree/v2.9.10" }, "funding": [ { @@ -15686,7 +15686,7 @@ "type": "patreon" } ], - "time": "2024-10-15T19:41:22+00:00" + "time": "2024-10-19T23:04:40+00:00" }, { "name": "laravel/pint", diff --git a/misc/testing/NZB/nzb-reorg.php b/misc/testing/NZB/nzb-reorg.php index f7074fe26..523e25d00 100755 --- a/misc/testing/NZB/nzb-reorg.php +++ b/misc/testing/NZB/nzb-reorg.php @@ -43,5 +43,5 @@ foreach ($objects as $filestoprocess => $nzbFile) { } } -Settings::query()->where(['setting' => 'nzbsplitlevel'])->update(['value' => $argv[1]]); +Settings::query()->where(['name' => 'nzbsplitlevel'])->update(['value' => $argv[1]]); $consoleTools->overWrite("Processed $iFilesProcessed nzbs in ".$time->diffForHumans()."\n");