Remove _ignoreFileCount function

This commit is contained in:
DariusIII
2023-03-07 10:53:30 +01:00
parent ce00652a0f
commit 1370181927
+1 -21
View File
@@ -721,15 +721,8 @@ class Binaries
foreach ($headers as $this->header) {
// Set up the info for inserting into parts/binaries/collections tables.
if (! isset($articles[$this->header['matches'][1]])) {
// check whether file count should be ignored (XXX packs for now only).
$whitelistMatch = false;
if ($this->_ignoreFileCount($this->groupMySQL['name'], $this->header['matches'][1])) {
$whitelistMatch = true;
$fileCount[1] = $fileCount[3] = 0;
}
// Attempt to find the file count. If it is not found, set it to 0.
if (! $whitelistMatch && ! preg_match('/[[(\s](\d{1,5})(\/|[\s_]of[\s_]|-)(\d{1,5})[])\s$:]/i', $this->header['matches'][1], $fileCount)) {
if (! preg_match('/[[(\s](\d{1,5})(\/|[\s_]of[\s_]|-)(\d{1,5})[])\s$:]/i', $this->header['matches'][1], $fileCount)) {
$fileCount[1] = $fileCount[3] = 0;
}
@@ -1510,19 +1503,6 @@ class Binaries
}
}
/**
* Check if we should ignore the file count and return true or false.
*/
protected function _ignoreFileCount(string $groupName, string $subject): bool
{
$ignore = false;
if (($groupName === 'alt.binaries.erotica') && preg_match('/^\[\d+\]-\[FULL\]-\[#a\.b\.erotica@EFNet\]-\[ \d{2,3}_/', $subject)) {
$ignore = true;
}
return $ignore;
}
protected function runQuery($query): bool
{
try {