Пример #1
0
                        }
                    }
                }
                break;
            case $pieces[0] === 'miscsorter' && isset($guidChar) && isset($maxperrun) && is_numeric($maxperrun):
                $releases = $pdo->queryDirect(sprintf('
								SELECT r.id AS releaseid
								FROM releases r
								WHERE r.guid %s
								AND r.nzbstatus = 1 AND r.nfostatus = 1
								AND r.proc_sorter = 0 AND r.isrenamed = 0
								AND r.preid = 0
								ORDER BY r.postdate DESC
								LIMIT %s', $pdo->likeString($guidChar, false, true), $maxperrun));
                if ($releases instanceof \Traversable) {
                    $sorter = new MiscSorter(true, $pdo);
                    foreach ($releases as $release) {
                        $res = $sorter->nfosorter(null, $release['releaseid']);
                    }
                }
                break;
            case $pieces[0] === 'predbft' && isset($maxperrun) && is_numeric($maxperrun) && isset($thread) && is_numeric($thread):
                $pres = $pdo->queryDirect(sprintf('
							SELECT p.id AS preid, p.title, p.source, p.searched
							FROM predb p
							WHERE LENGTH(title) >= 15 AND title NOT REGEXP "[\\"\\<\\> ]"
							AND searched = 0
							AND DATEDIFF(NOW(), predate) > 1
							ORDER BY predate ASC
							LIMIT %s
							OFFSET %s', $maxperrun, $thread * $maxperrun - $maxperrun));
Пример #2
0
     $guid = $pieces[2];
     $groupID = $pieces[3];
     $nzbcontents = new NZBContents(array('Echo' => true, 'NNTP' => $nntp, 'Settings' => $pdo, 'Nfo' => new Nfo(['Settings' => $pdo, 'Echo' => true]), 'PostProcess' => new PostProcess(['Settings' => $pdo, 'NameFixer' => $namefixer])));
     //echo " " . microtime();
     $res = $nzbcontents->checkPAR2($guid, $relID, $groupID, 1, 1);
     //echo " " . microtime() . " ";
     if ($res === false) {
         echo '.';
     }
 } else {
     if (isset($pieces[1]) && $pieces[0] == 'miscsorter') {
         $nntp = new NNTP(['Settings' => $pdo]);
         if (($pdo->getSetting('alternate_nntp') == 1 ? $nntp->doConnect(true, true) : $nntp->doConnect()) !== true) {
             exit($pdo->log->error("Unable to connect to usenet."));
         }
         $sorter = new MiscSorter(true);
         $relID = $pieces[1];
         $res = $sorter->nfosorter(null, $relID, $nntp);
         if ($res != true) {
             $pdo->queryExec(sprintf('UPDATE releases SET proc_sorter = 1 WHERE id = %d', $relID));
             echo '.';
         }
     } else {
         if (isset($pieces[1]) && $pieces[0] == 'predbft') {
             $pre = $pieces[1];
             if ($res = $pdo->queryOneRow(sprintf('SELECT id AS preid, title, source, searched FROM predb ' . 'WHERE id = %d', $pre))) {
                 $namefixer->done = $namefixer->matched = false;
                 $ftmatched = $searched = 0;
                 $ftmatched = $namefixer->matchPredbFT($res, 1, 1, true, 1);
                 if ($ftmatched > 0) {
                     $searched = 1;