mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-09-02 11:18:56 +00:00
Rename groups table to usenet_groups as groups is a reserved word in mysql now
This commit is contained in:
@@ -4,7 +4,7 @@ namespace Blacklight\processing;
|
||||
|
||||
use Blacklight\NZB;
|
||||
use Blacklight\NNTP;
|
||||
use App\Models\Group;
|
||||
use App\Models\UsenetGroup;
|
||||
use App\Models\Predb;
|
||||
use Blacklight\Genres;
|
||||
use App\Models\Release;
|
||||
@@ -164,7 +164,7 @@ class ProcessReleases
|
||||
$groupID = '';
|
||||
|
||||
if (! empty($groupName) && $groupName !== 'mgr') {
|
||||
$groupInfo = Group::getByName($groupName);
|
||||
$groupInfo = UsenetGroup::getByName($groupName);
|
||||
if ($groupInfo !== null) {
|
||||
$groupID = $groupInfo['id'];
|
||||
}
|
||||
@@ -377,7 +377,7 @@ class ProcessReleases
|
||||
$this->colorCli->header('Process Releases -> Delete collections smaller/larger than minimum size/file count from group/site setting.');
|
||||
}
|
||||
|
||||
$groupID === '' ? $groupIDs = Group::getActiveIDs() : $groupIDs = [['id' => $groupID]];
|
||||
$groupID === '' ? $groupIDs = UsenetGroup::getActiveIDs() : $groupIDs = [['id' => $groupID]];
|
||||
|
||||
$minSizeDeleted = $maxSizeDeleted = $minFilesDeleted = 0;
|
||||
|
||||
@@ -388,7 +388,7 @@ class ProcessReleases
|
||||
foreach ($groupIDs as $grpID) {
|
||||
$groupMinSizeSetting = $groupMinFilesSetting = 0;
|
||||
|
||||
$groupMinimums = Group::getGroupByID($grpID['id']);
|
||||
$groupMinimums = UsenetGroup::getGroupByID($grpID['id']);
|
||||
if ($groupMinimums !== null) {
|
||||
if (! empty($groupMinimums['minsizetoformrelease']) && $groupMinimums['minsizetoformrelease'] > 0) {
|
||||
$groupMinSizeSetting = (int) $groupMinimums['minsizetoformrelease'];
|
||||
@@ -480,7 +480,7 @@ class ProcessReleases
|
||||
'
|
||||
SELECT SQL_NO_CACHE c.*, g.name AS gname
|
||||
FROM collections c
|
||||
INNER JOIN groups g ON c.groups_id = g.id
|
||||
INNER JOIN usenet_groups g ON c.groups_id = g.id
|
||||
WHERE %s c.filecheck = %d
|
||||
AND c.filesize > 0
|
||||
LIMIT %d',
|
||||
@@ -584,12 +584,12 @@ class ProcessReleases
|
||||
if (preg_match_all('#(\S+):\S+#', $collection->xref, $matches)) {
|
||||
foreach ($matches[1] as $grp) {
|
||||
//check if the group name is in a valid format
|
||||
$grpTmp = Group::isValidGroup($grp);
|
||||
$grpTmp = UsenetGroup::isValidGroup($grp);
|
||||
if ($grpTmp !== false) {
|
||||
//check if the group already exists in database
|
||||
$xrefGrpID = Group::getIDByName($grpTmp);
|
||||
$xrefGrpID = UsenetGroup::getIDByName($grpTmp);
|
||||
if ($xrefGrpID === '') {
|
||||
$xrefGrpID = Group::addGroup(
|
||||
$xrefGrpID = UsenetGroup::addGroup(
|
||||
[
|
||||
'name' => $grpTmp,
|
||||
'description' => 'Added by Release processing',
|
||||
@@ -1008,7 +1008,7 @@ class ProcessReleases
|
||||
$this->colorCli->header('Process Releases -> Delete releases smaller/larger than minimum size/file count from group/site setting.');
|
||||
}
|
||||
|
||||
$groupID === '' ? $groupIDs = Group::getActiveIDs() : $groupIDs = [['id' => $groupID]];
|
||||
$groupID === '' ? $groupIDs = UsenetGroup::getActiveIDs() : $groupIDs = [['id' => $groupID]];
|
||||
|
||||
$maxSizeSetting = Settings::settingValue('.release.maxsizetoformrelease');
|
||||
$minSizeSetting = Settings::settingValue('.release.minsizetoformrelease');
|
||||
@@ -1020,7 +1020,7 @@ class ProcessReleases
|
||||
'
|
||||
SELECT SQL_NO_CACHE r.guid, r.id
|
||||
FROM releases r
|
||||
INNER JOIN groups g ON g.id = r.groups_id
|
||||
INNER JOIN usenet_groups g ON g.id = r.groups_id
|
||||
WHERE r.groups_id = %d
|
||||
AND greatest(IFNULL(g.minsizetoformrelease, 0), %d) > 0
|
||||
AND r.size < greatest(IFNULL(g.minsizetoformrelease, 0), %d)',
|
||||
@@ -1057,7 +1057,7 @@ class ProcessReleases
|
||||
'
|
||||
SELECT SQL_NO_CACHE r.id, r.guid
|
||||
FROM releases r
|
||||
INNER JOIN groups g ON g.id = r.groups_id
|
||||
INNER JOIN usenet_groups g ON g.id = r.groups_id
|
||||
WHERE r.groups_id = %d
|
||||
AND greatest(IFNULL(g.minfilestoformrelease, 0), %d) > 0
|
||||
AND r.totalpart < greatest(IFNULL(g.minfilestoformrelease, 0), %d)',
|
||||
|
||||
Reference in New Issue
Block a user