From f0ca4c319345cf4faa111fbfe9a7f33ec466f958 Mon Sep 17 00:00:00 2001 From: DariusIII Date: Mon, 17 Jul 2017 00:09:20 +0200 Subject: [PATCH] Adjust Categorize class settings values --- Changelog | 2 ++ nntmux/Categorize.php | 6 ++++-- nntmux/db/populate/AniDB.php | 12 ++++++++---- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Changelog b/Changelog index 6519b3122..b602ae357 100755 --- a/Changelog +++ b/Changelog @@ -1,3 +1,5 @@ +2017-07-17 DariusIII + * Chg: Adjust Categorize class settings values 2017-17-16 DariusIII * Chg: Replace app with App in classes used * Chg: Update composer.lock diff --git a/nntmux/Categorize.php b/nntmux/Categorize.php index 09b7326ef..07ae99004 100755 --- a/nntmux/Categorize.php +++ b/nntmux/Categorize.php @@ -53,12 +53,14 @@ class Categorize extends Category * Construct. * * @param array $options Class instances. + * + * @throws \Exception */ public function __construct(array $options = []) { parent::__construct($options); - $this->categorizeForeign = Settings::value('indexer.categorise.categorizeforeign'); - $this->catWebDL = Settings::value('indexer.categorise.catwebdl'); + $this->categorizeForeign = (int)Settings::value('indexer.categorise.categorizeforeign'); + $this->catWebDL = (int)Settings::value('indexer.categorise.catwebdl'); $this->regexes = new Regexes(['Settings' => $this->pdo, 'Table_Name' => 'category_regexes']); } diff --git a/nntmux/db/populate/AniDB.php b/nntmux/db/populate/AniDB.php index d13192db1..e930b1644 100755 --- a/nntmux/db/populate/AniDB.php +++ b/nntmux/db/populate/AniDB.php @@ -24,7 +24,7 @@ class AniDB public $imgSavePath; /** - * @var Settings + * @var DB */ public $pdo; @@ -60,6 +60,8 @@ class AniDB /** * @param array $options Class instances / Echo to cli. + * + * @throws \Exception */ public function __construct(array $options = []) { @@ -86,8 +88,10 @@ class AniDB /** * Main switch that initiates AniDB table population * - * @param string $type - * @param int|string $anidbId + * @param string $type + * @param int|string $anidbId + * + * @throws \Exception */ public function populateTable($type = '', $anidbId = ''): void { @@ -508,7 +512,7 @@ class AniDB */ private function setLastUpdated(): void { - Settings::update( + (new Settings)->update( ['value' => time()], ['section' => 'APIs', 'subsection' => 'AniDB', 'name' => 'last_full_update'] );