mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-09-03 11:49:03 +00:00
Remove tpg check from binaries, start making tablepergroup mandatory
This commit is contained in:
@@ -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
|
||||
|
||||
+6
-15
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user