From 60ec243af21602bc0e45d285bc4b5de484c36d30 Mon Sep 17 00:00:00 2001 From: DariusIII Date: Fri, 24 Feb 2017 11:37:56 +0100 Subject: [PATCH] Remove tpg check from binaries, start making tablepergroup mandatory --- Changelog | 1 + nntmux/Binaries.php | 21 ++++++--------------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/Changelog b/Changelog index de1ca9baf..4cb2e746f 100755 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ 2017-02-24 DariusIII + * Chg: Start to make tablepergroup mandatory, remove tpg check from Binaries * Fix: Fix code in Binaries class 2017-02-23 DariusIII * Chg: Start to slowly refactor code for PHP 7 diff --git a/nntmux/Binaries.php b/nntmux/Binaries.php index 00edba048..559332a60 100755 --- a/nntmux/Binaries.php +++ b/nntmux/Binaries.php @@ -119,13 +119,6 @@ class Binaries */ protected $_showDroppedYEncParts; - /** - * Should we use table per group? - * - * @var bool - */ - protected $_tablePerGroup; - /** * Echo to cli? * @@ -286,7 +279,6 @@ class Binaries $this->_partRepairLimit = Settings::value('..maxpartrepair') != '' ? (int)Settings::value('..maxpartrepair') : 15000; $this->_partRepairMaxTries = (Settings::value('..partrepairmaxtries') != '' ? (int)Settings::value('..partrepairmaxtries') : 3); $this->_showDroppedYEncParts = Settings::value('..showdroppedyencparts') == 1 ? true : false; - $this->_tablePerGroup = Settings::value('..tablepergroup') == 1 ? true : false; $this->blackList = $this->whiteList = []; } @@ -615,7 +607,7 @@ class Binaries $this->notYEnc = $this->headersBlackListed = 0; // Check if MySQL tables exist, create if they do not, get their names at the same time. - $this->tableNames = $this->_groups->getCBPTableNames($this->_tablePerGroup, $this->groupMySQL['id']); + $this->tableNames = $this->_groups->getCBPTableNames($this->groupMySQL['id']); $mgrPosters = $this->getMultiGroupPosters(); @@ -782,7 +774,7 @@ class Binaries // Standard headers go second so we can switch tableNames back and do part repair to standard group tables if (!empty($stdHeaders)) { - $this->tableNames = $this->_groups->getCBPTableNames($this->_tablePerGroup, $this->groupMySQL['id']); + $this->tableNames = $this->_groups->getCBPTableNames($this->groupMySQL['id']); $this->storeHeaders($stdHeaders, false); } unset($stdHeaders); @@ -1144,7 +1136,7 @@ class Binaries */ public function partRepair($groupArr) { - $tableNames = $this->_groups->getCBPTableNames($this->_tablePerGroup, $groupArr['id']); + $tableNames = $this->_groups->getCBPTableNames($groupArr['id']); // Get all parts in partrepair table. $missingParts = $this->_pdo->query( sprintf(' @@ -1280,7 +1272,7 @@ class Binaries $groupID = $this->_groups->getIDByName($groupData['group']); $group = []; if ($groupID !== '') { - $group = $this->_groups->getCBPTableNames($this->_tablePerGroup, $groupID); + $group = $this->_groups->getCBPTableNames($groupID); } $currentPost = $post; @@ -1297,12 +1289,11 @@ class Binaries INNER JOIN %s b ON(c.id=b.collections_id) INNER JOIN %s p ON(b.id=p.binaries_id) WHERE p.number = %s - %s LIMIT 1', + LIMIT 1', $group['cname'], $group['bname'], $group['pname'], - $currentPost, - $this->_tablePerGroup === false ? sprintf('AND c.groups_id = %d', $groupID) : '' + $currentPost ) ); if ($local !== false) {