diff --git a/lib/Info.php b/lib/Info.php index ac832422f..f65c77483 100644 --- a/lib/Info.php +++ b/lib/Info.php @@ -108,11 +108,10 @@ class Info } /** - * Look for a TvRage id in a string. + * Look for a TvRage ID in a string. * - * @param string $str The string with a TvRage id. - * - * @return string The TVRage id on success. + * @param string $str The string with a TvRage ID. + * @return string The TVRage ID on success. * @return bool False on failure. * * @access public @@ -144,7 +143,7 @@ class Info if ($size < 65535 && $size > 11 && !preg_match( - '/\A(\s*<\?xml|=newz\[NZB\]=|RIFF|\s*[RP]AR|.{0,10}(JFIF|matroska|ftyp|id3))|;\s*Generated\s*by.*SF\w/i' + '/\A(\s*<\?xml|=newz\[NZB\]=|RIFF|\s*[RP]AR|.{0,10}(JFIF|matroska|ftyp|ID3))|;\s*Generated\s*by.*SF\w/i' , $possibleNFO ) ) { @@ -213,20 +212,20 @@ class Info */ public function addAlternateNfo(&$nfo, $release, $nntp) { - if ($release['id'] > 0 && $this->isNFO($nfo, $release['guid'])) { + if ($release['ID'] > 0 && $this->isNFO($nfo, $release['guid'])) { - $check = $this->db->queryOneRow(sprintf('SELECT id FROM releasenfo WHERE releaseid = %d', $release['id'])); + $check = $this->db->queryOneRow(sprintf('SELECT ID FROM releasenfo WHERE releaseID = %d', $release['ID'])); if ($check === false) { $this->db->queryInsert( - sprintf('INSERT INTO releasenfo (nfo, releaseid) VALUES (compress(%s), %d)', + sprintf('INSERT INTO releasenfo (nfo, releaseID) VALUES (compress(%s), %d)', $this->db->escapeString($nfo), - $release['id'] + $release['ID'] ) ); } - $this->db->exec(sprintf('UPDATE releases SET releasenfoid = 1, nfostatus = %d WHERE id = %d', self::NFO_FOUND, $release['id'])); + $this->db->exec(sprintf('UPDATE releases SET releasenfoID = 1, nfostatus = %d WHERE ID = %d', self::NFO_FOUND, $release['ID'])); if (!isset($release['completion'])) { $release['completion'] = 0; @@ -242,7 +241,7 @@ class Info 'pp' => new PProcess(true) ) ); - $nzbContents->parseNZB($release['guid'], $release['id'], $release['groupid']); + $nzbContents->parseNZB($release['guid'], $release['ID'], $release['groupID']); } return true; } @@ -255,20 +254,19 @@ class Info * @param string $releaseToWork * @param int $processImdb Attempt to find IMDB id's in the NZB? * @param int $processTvrage Attempt to find TvRage id's in the NZB? - * @param string $groupid (optional) The group id to work on. + * @param string $groupID (optional) The group ID to work on. * @param object $nntp Instance of class NNTP. * * @return int How many NFO's were processed? * */ - public function processNfoFiles($releaseToWork = '', $processImdb = 1, $processTvrage = 1, $groupid = '', $nntp) - { + public function processNfoFiles($releaseToWork = '', $processImdb = 1, $processTvrage = 1, $groupID = '', $nntp) { if (!isset($nntp)) { exit($this->c->error("Unable to connect to usenet.\n")); } $nfoCount = $ret = 0; - $groupid = ($groupid === '' ? '' : 'AND groupid = ' . $groupid); + $groupID = ($groupID === '' ? '' : 'AND groupID = ' . $groupID); $res = array(); if ($releaseToWork === '') { @@ -276,7 +274,7 @@ class Info while (($nfoCount != $this->nzbs) && ($i >= -6)) { $res += $this->db->query( sprintf(' - SELECT id, guid, groupid, name + SELECT ID, guid, groupID, name FROM releases WHERE nfostatus BETWEEN %d AND %d AND size < %s @@ -285,7 +283,7 @@ class Info $i, self::NFO_UNPROC, $this->maxsize * 1073741824, - $groupid, + $groupID, $this->nzbs ) ); @@ -294,7 +292,7 @@ class Info } } else { $pieces = explode(' =+= ', $releaseToWork); - $res = array(array('id' => $pieces[0], 'guid' => $pieces[1], 'groupid' => $pieces[2], 'name' => $pieces[3])); + $res = array(array('ID' => $pieces[0], 'guid' => $pieces[1], 'groupID' => $pieces[2], 'name' => $pieces[3])); $nfoCount = 1; } @@ -323,7 +321,7 @@ class Info $tvRage = new TvAnger($this->echo); foreach ($res as $arr) { - $fetchedBinary = $nzbContents->getNFOfromNZB($arr['guid'], $arr['id'], $arr['groupid'], $functions->getByNameByid($arr['groupid'])); + $fetchedBinary = $nzbContents->getNFOfromNZB($arr['guid'], $arr['ID'], $arr['groupID'], $functions->getByNameByID($arr['groupID'])); if ($fetchedBinary !== false) { // Insert nfo into database. $cp = $nc = null; @@ -334,13 +332,13 @@ class Info $cp = '%s'; $nc = $this->db->escapeString(utf8_encode($fetchedBinary)); } - $ckreleaseid = $this->db->queryOneRow(sprintf('SELECT id FROM releasenfo WHERE releaseid = %d', $arr['id'])); - if (!isset($ckreleaseid['id'])) { - $this->db->queryInsert(sprintf('INSERT INTO releasenfo (nfo, releaseid) VALUES (' . $cp . ', %d)', $nc, $arr['id'])); + $ckreleaseid = $this->db->queryOneRow(sprintf('SELECT ID FROM releasenfo WHERE releaseID = %d', $arr['ID'])); + if (!isset($ckreleaseid['ID'])) { + $this->db->queryInsert(sprintf('INSERT INTO releasenfo (nfo, releaseID) VALUES (' . $cp . ', %d)', $nc, $arr['ID'])); } - $this->db->exec(sprintf('UPDATE releases SET releasenfoid = 1, nfostatus = %d WHERE id = %d', self::NFO_FOUND, $arr['id'])); + $this->db->exec(sprintf('UPDATE releases SET releasenfoID = 1, nfostatus = %d WHERE ID = %d', self::NFO_FOUND, $arr['ID'])); $ret++; - $movie->doMovieUpdate($fetchedBinary, 'nfo', $arr['id'], $processImdb); + $movie->doMovieUpdate($fetchedBinary, 'nfo', $arr['ID'], $processImdb); // If set scan for tvrage info. if ($processTvrage == 1) { @@ -349,12 +347,12 @@ class Info $show = $tvRage->parseNameEpSeason($arr['name']); if (is_array($show) && $show['name'] != '') { // Update release with season, ep, and air date info (if available) from release title. - $tvRage->updateEpInfo($show, $arr['id']); + $tvRage->updateEpInfo($show, $arr['ID']); - $rid = $tvRage->getByRageid($rageId); + $rid = $tvRage->getByRageID($rageId); if (!$rid) { $tvrShow = $tvRage->getRageInfoFromService($rageId); - $tvRage->updateRageInfo($rageId, $show, $tvrShow, $arr['id']); + $tvRage->updateRageInfo($rageId, $show, $tvrShow, $arr['ID']); } } } @@ -365,9 +363,9 @@ class Info // Remove nfo that we cant fetch after 5 attempts. if ($releaseToWork === '') { - $relres = $this->db->query('SELECT id FROM releases WHERE nfostatus < -6 AND releasenfoid = -1'); + $relres = $this->db->query('SELECT ID FROM releases WHERE nfostatus < -6 AND releasenfoID = -1'); foreach ($relres as $relrow) { - $this->db->exec(sprintf('DELETE FROM releasenfo WHERE nfo IS NULL AND releaseid = %d', $relrow['id'])); + $this->db->exec(sprintf('DELETE FROM releasenfo WHERE nfo IS NULL AND releaseID = %d', $relrow['ID'])); } if ($this->echo) { diff --git a/lib/Pprocess.php b/lib/Pprocess.php index 9f2f66de5..1214c3b61 100644 --- a/lib/Pprocess.php +++ b/lib/Pprocess.php @@ -216,7 +216,7 @@ class PProcess public function processNfos($releaseToWork = '', $nntp) { if ($this->site->lookupnfo === '1') { - $this->Nfo->processNfoFiles($releaseToWork, $this->site->lookupimdb, $this->site->lookuptvrage, $groupid = '', $nntp); + $this->Nfo->processNfoFiles($releaseToWork, $this->site->lookupimdb, $this->site->lookuptvrage, $groupID = '', $nntp); } } @@ -265,14 +265,14 @@ class PProcess * * @param NNTP $nntp Class NNTP * @param string $releaseToWork String containing SQL results. Optional. - * @param string $groupid Group id. Optional + * @param string $groupID Group ID. Optional * * @return void */ - public function processAdditional($nntp, $releaseToWork = '', $groupid = '') + public function processAdditional($nntp, $releaseToWork = '', $groupID = '') { $processAdditional = new ProcessAdditional($this->echooutput, $nntp, $this->db, $this->site, $this->tmux); - $processAdditional->start($releaseToWork, $groupid); + $processAdditional->start($releaseToWork, $groupID); } /** @@ -280,25 +280,25 @@ class PProcess * * @note Called from NZBContents.php * - * @param string $messageid Messageid from NZB file. - * @param int $relid id of the release. - * @param int $groupid Group id of the release. + * @param string $messageID MessageID from NZB file. + * @param int $relID ID of the release. + * @param int $groupID Group ID of the release. * @param NNTP $nntp Class NNTP * @param int $show Only show result or apply iy. * * @return bool */ - public function parsePAR2($messageid, $relid, $groupid, $nntp, $show) + public function parsePAR2($messageID, $relID, $groupID, $nntp, $show) { - if ($messageid === '') { + if ($messageID === '') { return false; } $query = $this->db->queryOneRow( sprintf(' - SELECT id, groupid, categoryid, name, searchname, UNIX_TIMESTAMP(postdate) AS post_date, IS AS releaseid - FROM releases WHERE isrenamed = 0 AND id = %d', - $relid + SELECT ID, groupID, categoryID, name, searchname, UNIX_TIMESTAMP(postdate) AS post_date, IS AS releaseID + FROM releases WHERE isrenamed = 0 AND ID = %d', + $relID ) ); @@ -309,7 +309,7 @@ class PProcess // Only get a new name if the category is OTHER. $foundName = true; if (!in_array( - (int)$query['categoryid'], + (int)$query['categoryID'], array( Category::CAT_MOVIE_OTHER, Category::CAT_PC_MOBILEOTHER, @@ -323,7 +323,7 @@ class PProcess } // Get the PAR2 file. - $par2 = $nntp->getMessages($this->functions->getByNameByid($groupid), $messageid); + $par2 = $nntp->getMessages($this->functions->getByNameByID($groupID), $messageID); if ($nntp->isError($par2)) { return false; } @@ -356,13 +356,13 @@ class PProcess // Add to release files. if ($filesAdded < 11 && $this->db->queryOneRow( - sprintf('SELECT id FROM releasefiles WHERE releaseid = %d AND name = %s', - $relid, $this->db->escapeString($file['name']) + sprintf('SELECT ID FROM releasefiles WHERE releaseID = %d AND name = %s', + $relID, $this->db->escapeString($file['name']) ) ) === false ) { // Try to add the files to the DB. - if ($this->releaseFiles->add($relid, $file['name'], $file['size'], $query['post_date'], 0)) { + if ($this->releaseFiles->add($relID, $file['name'], $file['size'], $query['post_date'], 0)) { $filesAdded++; } } else { @@ -381,9 +381,9 @@ class PProcess $this->db->exec( sprintf(' UPDATE releases SET rarinnerfilecount = rarinnerfilecount + %d - WHERE id = %d', + WHERE ID = %d', $filesAdded, - $relid + $relID ) ); } diff --git a/lib/ProcessAdditional.php b/lib/ProcessAdditional.php index ddeb40f97..430da3aa2 100644 --- a/lib/ProcessAdditional.php +++ b/lib/ProcessAdditional.php @@ -129,11 +129,11 @@ Class ProcessAdditional $this->_queryLimit = (!empty($this->_tmuxSettings->maxaddprocessed)) ? (int)$this->_tmuxSettings->maxaddprocessed : 25; - // Maximum message id's to download per file type in the NZB (video, jpg, etc). + // Maximum message ID's to download per file type in the NZB (video, jpg, etc). $this->_segmentsToDownload = (!empty($this->_tmuxSettings->segmentstodownload)) ? (int)$this->_tmuxSettings->segmentstodownload : 2; - // Maximum message id's to download for a RAR file. + // Maximum message ID's to download for a RAR file. $this->_maximumRarSegments = (!empty($this->_tmuxSettings->maxpartsprocessed)) ? (int)$this->_tmuxSettings->maxpartsprocessed : 3; @@ -180,27 +180,27 @@ Class ProcessAdditional * Main method. * * @param string $release Optional single release to work on. - * @param int|string $groupid Optional id of a group to work on. + * @param int|string $groupID Optional ID of a group to work on. * * @void */ - public function start($release = '', $groupid = '') + public function start($release = '', $groupID = '') { // Fetch all the releases to work on. if ($release === '') { - $this->_fetchReleases($groupid); + $this->_fetchReleases($groupID); } else { $release = explode(' =+= ', $release); $this->_releases = array( array( - 'id' => $release[0], + 'ID' => $release[0], 'guid' => $release[1], 'name' => $release[2], 'disablepreview' => $release[3], 'size' => $release[4], - 'groupid' => $release[5], + 'groupID' => $release[5], 'nfostatus' => $release[6], - 'categoryid' => $release[7], + 'categoryID' => $release[7], 'searchname' => $release[8] ) ); @@ -219,15 +219,15 @@ Class ProcessAdditional /** * Get all releases that need to be processed. * - * @param int|string $groupid + * @param int|string $groupID * * @void */ - protected function _fetchReleases($groupid) + protected function _fetchReleases($groupID) { $this->_releases = array(); $this->_totalReleases = 0; - $groupid = ($groupid === '' ? '' : 'AND r.groupid = ' . $groupid); + $groupID = ($groupID === '' ? '' : 'AND r.groupID = ' . $groupID); $i = -6; $limit = $this->_queryLimit; @@ -236,10 +236,10 @@ Class ProcessAdditional $releases = $this->_db->query( sprintf(' - SELECT r.id, r.guid, r.name, c.disablepreview, r.size, r.groupid, - r.nfostatus, r.completion, r.categoryid, r.searchname + SELECT r.ID, r.guid, r.name, c.disablepreview, r.size, r.groupID, + r.nfostatus, r.completion, r.categoryID, r.searchname FROM releases r - LEFT JOIN category c ON c.id = r.categoryid + LEFT JOIN category c ON c.ID = r.categoryID WHERE nzbstatus = 1 AND r.size < %d %s @@ -247,7 +247,7 @@ Class ProcessAdditional AND (r.haspreview = -1 AND c.disablepreview = 0) ORDER BY postdate DESC LIMIT %d', - $this->_maxSize, $groupid, $i, $limit + $this->_maxSize, $groupID, $i, $limit ) ); @@ -304,7 +304,7 @@ Class ProcessAdditional { foreach ($this->_releases as $this->_release) { $this->_echo( - '[' . $this->_release['id'] . '][' . + '[' . $this->_release['ID'] . '][' . $this->_readableBytesString($this->_release['size']) . ']', false ); @@ -351,14 +351,14 @@ Class ProcessAdditional } } - // Process usenet Message-id downloads. + // Process usenet Message-ID downloads. if ($this->_processPasswords === true || $this->_processSample === true || $this->_processMediaInfo === true || $this->_processAudioInfo === true || $this->_processVideo === true ) { - $this->_processMessageidDownloads(); + $this->_processMessageIDDownloads(); } // Update the release to say we processed it. @@ -400,8 +400,8 @@ Class ProcessAdditional // Decrement password status. $this->_db->exec( sprintf( - 'UPDATE releases SET passwordstatus = passwordstatus - 1 WHERE id = %d', - $this->_release['id'] + 'UPDATE releases SET passwordstatus = passwordstatus - 1 WHERE ID = %d', + $this->_release['ID'] ) ); @@ -422,13 +422,13 @@ Class ProcessAdditional $nzbPath = $this->_nzb->NZBPath($this->_release['guid']); if ($nzbPath === false) { - $this->_echo('NZB not found for GUid: ' . $this->_release['guid']); + $this->_echo('NZB not found for GUID: ' . $this->_release['guid']); // The nzb was not located. decrement the password status. $this->_db->exec( sprintf( - 'UPDATE releases SET passwordstatus = passwordstatus - 1 WHERE id = %d', - $this->_release['id'] + 'UPDATE releases SET passwordstatus = passwordstatus - 1 WHERE ID = %d', + $this->_release['ID'] ) ); @@ -448,13 +448,13 @@ Class ProcessAdditional $this->_nzbContents = $this->_nzb->nzbFileList($nzbContents); if (count($this->_nzbContents) === 0) { - $this->_echo('NZB is empty or broken for GUid: ' . $this->_release['guid']); + $this->_echo('NZB is empty or broken for GUID: ' . $this->_release['guid']); // There does not appear to be any files in the nzb, decrement password status. $this->_db->exec( sprintf( - 'UPDATE releases SET passwordstatus = passwordstatus - 1 WHERE id = %d', - $this->_release['id'] + 'UPDATE releases SET passwordstatus = passwordstatus - 1 WHERE ID = %d', + $this->_release['ID'] ) ); @@ -482,7 +482,7 @@ Class ProcessAdditional protected $_NZBHasCompressedFile; /** - * Process the files inside the NZB, find Message-id's to download. + * Process the files inside the NZB, find Message-ID's to download. * If we find files with book extensions, return the amount. * * @return int @@ -508,7 +508,7 @@ Class ProcessAdditional // Look for a video sample, make sure it's not an image. if ($this->_processSample === true && - empty($this->_sampleMessageids) && + empty($this->_sampleMessageIDs) && preg_match('/sample/i', $this->_currentNZBFile['title']) && !preg_match('/\.jpe?g/i', $this->_currentNZBFile['title']) ) { @@ -519,7 +519,7 @@ Class ProcessAdditional // If it's more than 1 try to get up to the site specified value of segments. for ($i = 0; $i < $this->_segmentsToDownload; $i++) { if ($segCount > $i) { - $this->_sampleMessageids[] = (string)$this->_currentNZBFile['segments'][$i]; + $this->_sampleMessageIDs[] = (string)$this->_currentNZBFile['segments'][$i]; } else { break; } @@ -529,7 +529,7 @@ Class ProcessAdditional // Look for a JPG picture, make sure it's not a CD cover. if ($this->_processJPGSample === true && - empty($this->_JPGMessageids) && + empty($this->_JPGMessageIDs) && !preg_match('/flac|lossless|mp3|music|inner-sanctum|sound/i', $this->_releaseGroupName) && preg_match('/\.jpe?g[. ")\]]/i', $this->_currentNZBFile['title']) ) { @@ -540,7 +540,7 @@ Class ProcessAdditional // If it's more than 1 try to get up to the site specified value of segments. for ($i = 0; $i < $this->_segmentsToDownload; $i++) { if ($segCount > $i) { - $this->_JPGMessageids[] = (string)$this->_currentNZBFile['segments'][$i]; + $this->_JPGMessageIDs[] = (string)$this->_currentNZBFile['segments'][$i]; } else { break; } @@ -550,26 +550,26 @@ Class ProcessAdditional // Look for a video file, make sure it's not a sample, for MediaInfo. if ($this->_processMediaInfo === true && - empty($this->_MediaInfoMessageids) && + empty($this->_MediaInfoMessageIDs) && !preg_match('/sample/i', $this->_currentNZBFile['title']) && preg_match('/' . $this->_videoFileRegex . '[. ")\]]/i', $this->_currentNZBFile['title']) ) { if (isset($this->_currentNZBFile['segments'])) { - $this->_MediaInfoMessageids = (string)$this->_currentNZBFile['segments'][0]; + $this->_MediaInfoMessageIDs = (string)$this->_currentNZBFile['segments'][0]; } } // Look for a audio file. if ($this->_processAudioInfo === true && - empty($this->_AudioInfoMessageids) && + empty($this->_AudioInfoMessageIDs) && preg_match('/' . $this->_audioFileRegex . '[. ")\]]/i', $this->_currentNZBFile['title'], $type) ) { if (isset($this->_currentNZBFile['segments'])) { // Get the extension. $this->_AudioInfoExtension = $type[1]; - $this->_AudioInfoMessageids = (string)$this->_currentNZBFile['segments'][0]; + $this->_AudioInfoMessageIDs = (string)$this->_currentNZBFile['segments'][0]; } } @@ -611,10 +611,10 @@ Class ProcessAdditional } // Get message-id's for the rar file. - $mid = array_slice((array)$nzbFile['segments'], 0, $this->_maximumRarSegments); + $mID = array_slice((array)$nzbFile['segments'], 0, $this->_maximumRarSegments); // Download the article(s) from usenet. - $fetchedBinary = $this->_nntp->getMessages($this->_releaseGroupName, $mid); + $fetchedBinary = $this->_nntp->getMessages($this->_releaseGroupName, $mID); if ($this->_nntp->isError($fetchedBinary)) { $fetchedBinary = false; } @@ -780,16 +780,16 @@ Class ProcessAdditional if ($this->_addedFileInfo < 11 && $this->_db->queryOneRow( sprintf(' - SELECT id FROM releasefiles - WHERE releaseid = %d + SELECT ID FROM releasefiles + WHERE releaseID = %d AND name = %s AND size = %d', - $this->_release['id'], $this->_db->escapeString($file['name']), $file['size'] + $this->_release['ID'], $this->_db->escapeString($file['name']), $file['size'] ) ) === false ) { - if ($this->_releaseFiles->add($this->_release['id'], $file['name'], $file['size'], $file['date'], $file['pass'])) { + if ($this->_releaseFiles->add($this->_release['ID'], $file['name'], $file['size'], $file['date'], $file['pass'])) { $this->_addedFileInfo++; if ($this->_echoCLI) { @@ -805,7 +805,7 @@ Class ProcessAdditional } //Run a PreDB filename check on insert to try and match the release else if (strpos($file['name'], '.') !== false) { $this->_release['filename'] = $this->_functions->cutStringUsingLast('.', $file['name'], 'left', false); - $this->_release['releaseid'] = $this->_release['id']; + $this->_release['releaseid'] = $this->_release['ID']; $this->_nameFixer->matchPredbFiles($this->_release, 1, 1, true, 1, 'full'); } } @@ -958,15 +958,15 @@ Class ProcessAdditional * * @void */ - protected function _processMessageidDownloads() + protected function _processMessageIDDownloads() { // Download and process sample image. if ($this->_foundSample === false || $this->_foundVideo === false) { - if (!empty($this->_sampleMessageids)) { + if (!empty($this->_sampleMessageIDs)) { // Download it from usenet. - $sampleBinary = $this->_nntp->getMessages($this->_releaseGroupName, $this->_sampleMessageids); + $sampleBinary = $this->_nntp->getMessages($this->_releaseGroupName, $this->_sampleMessageIDs); if ($this->_nntp->isError($sampleBinary)) { $sampleBinary = false; } @@ -993,8 +993,8 @@ Class ProcessAdditional $this->_foundVideo = $this->_getVideo($fileLocation); } - // Try to get media info. Don't get it here if $mediaMsgid is not empty. - if ($this->_foundMediaInfo === false && empty($mediaMsgid)) { + // Try to get media info. Don't get it here if $mediaMsgID is not empty. + if ($this->_foundMediaInfo === false && empty($mediaMsgID)) { $this->_foundMediaInfo = $this->_getMediaInfo($fileLocation); } @@ -1008,10 +1008,10 @@ Class ProcessAdditional // Download and process mediainfo. Also try to get a sample if we didn't get one yet. if ($this->_foundMediaInfo === false || $this->_foundSample === false || $this->_foundVideo === false) { - if (!empty($this->_MediaInfoMessageids)) { + if (!empty($this->_MediaInfoMessageIDs)) { // Try to download it from usenet. - $mediaBinary = $this->_nntp->getMessages($this->_releaseGroupName, $this->_MediaInfoMessageids); + $mediaBinary = $this->_nntp->getMessages($this->_releaseGroupName, $this->_MediaInfoMessageIDs); if ($this->_nntp->isError($mediaBinary)) { // If error set it to false. $mediaBinary = false; @@ -1054,9 +1054,9 @@ Class ProcessAdditional // Download audio file, use media info to try to get the artist / album. if (($this->_foundAudioInfo === false || $this->_foundAudioSample === false)) { - if (!empty($this->_AudioInfoMessageids)) { + if (!empty($this->_AudioInfoMessageIDs)) { // Try to download it from usenet. - $audioBinary = $this->_nntp->getMessages($this->_releaseGroupName, $this->_AudioInfoMessageids); + $audioBinary = $this->_nntp->getMessages($this->_releaseGroupName, $this->_AudioInfoMessageIDs); if ($this->_nntp->isError($audioBinary)) { $audioBinary = false; } @@ -1080,10 +1080,10 @@ Class ProcessAdditional } // Download JPG file. - if ($this->_foundJPGSample === false && !empty($this->_JPGMessageids)) { + if ($this->_foundJPGSample === false && !empty($this->_JPGMessageIDs)) { // Try to download it. - $jpgBinary = $this->_nntp->getMessages($this->_releaseGroupName, $this->_JPGMessageids); + $jpgBinary = $this->_nntp->getMessages($this->_releaseGroupName, $this->_JPGMessageIDs); if ($this->_nntp->isError($jpgBinary)) { $jpgBinary = false; } @@ -1109,8 +1109,8 @@ Class ProcessAdditional sprintf(' UPDATE releases SET jpgstatus = %d - WHERE id = %d', 1, - $this->_release['id'] + WHERE ID = %d', 1, + $this->_release['ID'] ) ); @@ -1151,11 +1151,11 @@ Class ProcessAdditional // Get the amount of files we found inside the RAR/ZIP files. $releaseFiles = $this->_db->queryOneRow( sprintf(' - SELECT COUNT(releasefiles.releaseid) AS count, + SELECT COUNT(releasefiles.releaseID) AS count, SUM(releasefiles.size) AS size FROM releasefiles - WHERE releaseid = %d', - $this->_release['id'] + WHERE releaseID = %d', + $this->_release['ID'] ) ); @@ -1170,25 +1170,25 @@ Class ProcessAdditional $query = sprintf(' UPDATE releases SET passwordstatus = passwordstatus - 1, rarinnerfilecount = %d %s %s %s - WHERE id = %d', + WHERE ID = %d', $releaseFiles['count'], $iSQL, $vSQL, $jSQL, - $this->_release['id'] + $this->_release['ID'] ); } // Else update the release with the password status (if the admin enabled the setting). else { $query = sprintf(' UPDATE releases SET passwordstatus = %d, rarinnerfilecount = %d %s %s %s - WHERE id = %d', + WHERE ID = %d', ($this->_processPasswords === true ? $this->_passwordStatus : Releases::PASSWD_NONE), $releaseFiles['count'], $iSQL, $vSQL, $jSQL, - $this->_release['id'] + $this->_release['ID'] ); } @@ -1252,8 +1252,8 @@ Class ProcessAdditional // Make sure the category is music or other. $rQuery = $this->_db->queryOneRow( sprintf( - 'SELECT searchname, categoryid as id, groupid FROM releases WHERE proc_pp = 0 AND id = %d', - $this->_release['id'] + 'SELECT searchname, categoryID as ID, groupID FROM releases WHERE proc_pp = 0 AND ID = %d', + $this->_release['ID'] ) ); @@ -1266,7 +1266,7 @@ Class ProcessAdditional Category::CAT_MOVIE_OTHER, Category::CAT_TV_OTHER ), - $rQuery['id'] + $rQuery['ID'] ) ) { return false; @@ -1306,18 +1306,18 @@ Class ProcessAdditional } else if ($ext === 'FLAC') { $newCat = Category::CAT_MUSIC_LOSSLESS; } else { - $newCat = $this->_categorize->determineCategory($rQuery['groupid'], $newName); + $newCat = $this->_categorize->determineCategory($rQuery['groupID'], $newName); } // Update the search name. $this->_db->exec( sprintf(' UPDATE releases - SET searchname = %s, categoryid = %d, iscategorized = 1, isrenamed = 1, proc_pp = 1 - WHERE id = %d', + SET searchname = %s, categoryID = %d, iscategorized = 1, isrenamed = 1, proc_pp = 1 + WHERE ID = %d', $this->_db->escapeString(substr($newName, 0, 255)), $newCat, - $this->_release['id'] + $this->_release['ID'] ) ); @@ -1326,14 +1326,14 @@ Class ProcessAdditional 'New name:(' . $newName . ') Old name:(' . $rQuery['searchname'] . ') New cat:(' . $newCat . - ') Old cat:(' . $rQuery['id'] . - ') Group:(' . $rQuery['groupid'] . - ') Method:(' . 'PostProccess getAudioInfo' . - ') Releaseid:(' . $this->_release['id'] . ')' + ') Old cat:(' . $rQuery['ID'] . + ') Group:(' . $rQuery['groupID'] . + ') Method:(' . 'PostProccess getAudioInfo' . + ') ReleaseID:(' . $this->_release['ID'] . ')' ); // Add the media info. - $this->_releaseExtra->addFromXml($this->_release['id'], $xmlArray); + $this->_releaseExtra->addFromXml($this->_release['ID'], $xmlArray); $retVal = true; $this->_foundAudioInfo = true; @@ -1403,8 +1403,8 @@ Class ProcessAdditional sprintf(' UPDATE releases SET audiostatus = 1 - WHERE id = %d', - $this->_release['id'] + WHERE ID = %d', + $this->_release['ID'] ) ); @@ -1444,9 +1444,9 @@ Class ProcessAdditional sprintf(' UPDATE releases SET jpgstatus = %d - WHERE id = %d', + WHERE ID = %d', 1, - $this->_release['id'] + $this->_release['ID'] ) ); } @@ -1721,8 +1721,8 @@ Class ProcessAdditional $xmlArray = implode("\n", $xmlArray); // Insert it into the DB. - $this->_releaseExtra->addFull($this->_release['id'], $xmlArray); - $this->_releaseExtra->addFromXml($this->_release['id'], $xmlArray); + $this->_releaseExtra->addFull($this->_release['ID'], $xmlArray); + $this->_releaseExtra->addFromXml($this->_release['ID'], $xmlArray); if ($this->_echoCLI) { echo 'm'; @@ -1752,8 +1752,8 @@ Class ProcessAdditional sprintf(' SELECT UNIX_TIMESTAMP(postdate) AS postdate FROM releases - WHERE id = %d', - $this->_release['id'] + WHERE ID = %d', + $this->_release['ID'] ) ); @@ -1763,7 +1763,7 @@ Class ProcessAdditional // Only get a new name if the category is OTHER. $foundName = true; - if (in_array(((int)$this->_release['categoryid']), + if (in_array(((int)$this->_release['categoryID']), array( Category::CAT_MOVIE_OTHER, Category::CAT_MUSIC_OTHER, @@ -1795,14 +1795,14 @@ Class ProcessAdditional if ($this->_addPAR2Files) { if ($filesAdded < 11 && $this->_db->queryOneRow( - sprintf('SELECT id FROM releasefiles WHERE releaseid = %d AND name = %s', - $this->_release['id'], $this->_db->escapeString($file['name']) + sprintf('SELECT ID FROM releasefiles WHERE releaseID = %d AND name = %s', + $this->_release['ID'], $this->_db->escapeString($file['name']) ) ) === false ) { // Try to add the files to the DB. - if ($this->_releaseFiles->add($this->_release['id'], $file['name'], $file['size'], $releaseInfo['postdate'], 0)) { + if ($this->_releaseFiles->add($this->_release['ID'], $file['name'], $file['size'], $releaseInfo['postdate'], 0)) { $filesAdded++; } } @@ -1813,7 +1813,7 @@ Class ProcessAdditional // Try to get a new name. if ($foundName === false) { $this->_release['textstring'] = $file['name']; - $this->_release['releaseid'] = $this->_release['id']; + $this->_release['releaseID'] = $this->_release['ID']; if ($this->_nameFixer->checkName($this->_release, ($this->_echoCLI ? 1 : 0), 'PAR2, ', 1, 1) === true) { $foundName = true; } @@ -1822,9 +1822,9 @@ Class ProcessAdditional // Update the file count with the new file count + old file count. $this->_db->exec( sprintf( - 'UPDATE releases SET rarinnerfilecount = rarinnerfilecount + %d WHERE id = %d', + 'UPDATE releases SET rarinnerfilecount = rarinnerfilecount + %d WHERE ID = %d', $filesAdded, - $this->_release['id'] + $this->_release['ID'] ) ); $this->_foundPAR2Info = true; @@ -1863,10 +1863,10 @@ Class ProcessAdditional } /* Try to get a video with it. - * Don't get it here if _sampleMessageids is empty + * Don't get it here if _sampleMessageIDs is empty * or has 1 message-id (Saves downloading another part). */ - if ($this->_foundVideo === false && count($this->_sampleMessageids) < 2) { + if ($this->_foundVideo === false && count($this->_sampleMessageIDs) < 2) { $this->_foundVideo = $this->_getVideo($this->tmpPath . 'sample.avi'); } @@ -1894,14 +1894,14 @@ Class ProcessAdditional $this->_db->exec( sprintf(' UPDATE releases - SET rageid = -1, seriesfull = NULL, season = NULL, episode = NULL, - tvtitle = NULL, tvairdate = NULL, imdbid = NULL, musicinfoid = NULL, - consoleinfoid = NULL, bookinfoid = NULL, anidbid = NULL, prehashid = 0, preid = NULL, - searchname = %s, isrenamed = 1, iscategorized = 1, proc_files = 1, categoryid = %d - WHERE id = %d', + SET rageID = -1, seriesfull = NULL, season = NULL, episode = NULL, + tvtitle = NULL, tvairdate = NULL, imdbID = NULL, musicinfoID = NULL, + consoleinfoID = NULL, bookinfoID = NULL, anidbID = NULL, prehashID = 0, preID = NULL, + searchname = %s, isrenamed = 1, iscategorized = 1, proc_files = 1, categoryID = %d + WHERE ID = %d', $this->_db->escapeString(substr($newName, 0, 255)), - $this->_categorize->determineCategory($this->_release['groupid'], $newName), - $this->_release['id'] + $this->_categorize->determineCategory($this->_release['groupID'], $newName), + $this->_release['ID'] ) ); break; @@ -2047,15 +2047,15 @@ Class ProcessAdditional protected $_foundPAR2Info; /** - * Message id's for found content to download. + * Message ID's for found content to download. * * @var array */ - protected $_sampleMessageids; - protected $_JPGMessageids; - protected $_MediaInfoMessageids; - protected $_AudioInfoMessageids; - protected $_RARFileMessageids; + protected $_sampleMessageIDs; + protected $_JPGMessageIDs; + protected $_MediaInfoMessageIDs; + protected $_AudioInfoMessageIDs; + protected $_RARFileMessageIDs; /** * Password status of the current release. @@ -2118,7 +2118,7 @@ Class ProcessAdditional $this->_passwordStatus = array(Releases::PASSWD_NONE); $this->_releaseHasPassword = false; - $this->_releaseGroupName = $this->_functions->getByNameByid($this->_release['groupid']); + $this->_releaseGroupName = $this->_functions->getByNameByID($this->_release['groupID']); $this->_releaseHasNoNFO = false; // Make sure we don't already have an nfo. @@ -2128,8 +2128,8 @@ Class ProcessAdditional $this->_NZBHasCompressedFile = false; - $this->_sampleMessageids = $this->_JPGMessageids = $this->_MediaInfoMessageids = array(); - $this->_AudioInfoMessageids = $this->_RARFileMessageids = array(); + $this->_sampleMessageIDs = $this->_JPGMessageIDs = $this->_MediaInfoMessageIDs = array(); + $this->_AudioInfoMessageIDs = $this->_RARFileMessageIDs = array(); $this->_AudioInfoExtension = ''; $this->_addedFileInfo = 0; diff --git a/lib/namefixer.php b/lib/namefixer.php index 4faedc5c3..4b5222e17 100644 --- a/lib/namefixer.php +++ b/lib/namefixer.php @@ -57,9 +57,9 @@ class NameFixer $this->echooutput = $echooutput; $this->relid = $this->fixed = $this->checked = 0; $this->db = new DB(); - $this->timeother = ' AND rel.adddate > (NOW() - INTERVAL 0 HOUR) AND rel.categoryid IN (2020, 6070, 5050, 8010) GROUP BY rel.id ORDER BY postdate DESC'; - $this->timeall = ' AND rel.adddate > (NOW() - INTERVAL 6 HOUR) GROUP BY rel.id ORDER BY postdate DESC'; - $this->fullother = ' AND rel.categoryid IN (2020, 6070, 5050, 8010) GROUP BY rel.id'; + $this->timeother = ' AND rel.adddate > (NOW() - INTERVAL 0 HOUR) AND rel.categoryID IN (2020, 6070, 5050, 8010) GROUP BY rel.ID ORDER BY postdate DESC'; + $this->timeall = ' AND rel.adddate > (NOW() - INTERVAL 6 HOUR) GROUP BY rel.ID ORDER BY postdate DESC'; + $this->fullother = ' AND rel.categoryID IN (2020, 6070, 5050, 8010) GROUP BY rel.ID'; $this->fullall = ''; $this->done = $this->matched = false; $this->c = new ColorCLI(); @@ -87,19 +87,19 @@ class NameFixer $preId = false; if ($cats === 3) { $query = ' - SELECT rel.id AS releaseid + SELECT rel.ID AS releaseID FROM releases rel - INNER JOIN releasenfo nfo ON (nfo.releaseid = rel.id) + INNER JOIN releasenfo nfo ON (nfo.releaseID = rel.ID) WHERE nzbstatus = 1 - AND prehashid = 0'; + AND prehashID = 0'; $cats = 2; $preId = true; } else { $query = ' - SELECT rel.id AS releaseid + SELECT rel.ID AS releaseID FROM releases rel - INNER JOIN releasenfo nfo ON (nfo.releaseid = rel.id) - WHERE (isrenamed = 0 OR rel.categoryid = 8010) + INNER JOIN releasenfo nfo ON (nfo.releaseID = rel.ID) + WHERE (isrenamed = 0 OR rel.categoryID = 8010) AND proc_nfo = 0'; } @@ -114,12 +114,12 @@ class NameFixer foreach ($releases as $rel) { $releaseRow = $this->db->queryOneRow( sprintf(' - SELECT nfo.releaseid AS nfoid, rel.groupid, rel.categoryid, rel.name, rel.searchname, - UNCOMPRESS(nfo) AS textstring, rel.id AS releaseid + SELECT nfo.releaseID AS nfoID, rel.groupID, rel.categoryID, rel.name, rel.searchname, + UNCOMPRESS(nfo) AS textstring, rel.ID AS releaseID FROM releases rel - INNER JOIN releasenfo nfo ON (nfo.releaseid = rel.id) - WHERE rel.id = %d', - $rel['releaseid'] + INNER JOIN releasenfo nfo ON (nfo.releaseID = rel.ID) + WHERE rel.ID = %d', + $rel['releaseID'] ) ); @@ -128,7 +128,7 @@ class NameFixer // Ignore encrypted NFOs. if (preg_match('/^=newz\[NZB\]=\w+/', $releaseRow['textstring'])) { $this->db->exec( - sprintf('UPDATE releases SET proc_nfo = 1 WHERE id = %d', $releaseRow['releaseid']) + sprintf('UPDATE releases SET proc_nfo = 1 WHERE ID = %d', $releaseRow['releaseID']) ); continue; } @@ -161,22 +161,22 @@ class NameFixer $preId = false; if ($cats === 3) { $query = ' - SELECT relfiles.name AS textstring, rel.categoryid, rel.name, rel.searchname, rel.groupid, - relfiles.releaseid AS fileid, rel.id AS releaseid + SELECT relfiles.name AS textstring, rel.categoryID, rel.name, rel.searchname, rel.groupID, + relfiles.releaseID AS fileID, rel.ID AS releaseID FROM releases rel - INNER JOIN releasefiles relfiles ON (relfiles.releaseid = rel.id) + INNER JOIN releasefiles relfiles ON (relfiles.releaseID = rel.ID) WHERE nzbstatus = 1 - AND prehashid = 0'; + AND prehashID = 0'; $cats = 2; $preId = true; } else { $query = ' - SELECT relfiles.name AS textstring, rel.categoryid, rel.name, rel.searchname, rel.groupid, - relfiles.releaseid AS fileid, rel.id AS releaseid + SELECT relfiles.name AS textstring, rel.categoryID, rel.name, rel.searchname, rel.groupID, + relfiles.releaseID AS fileID, rel.ID AS releaseID FROM releases rel - INNER JOIN releasefiles relfiles ON (relfiles.releaseid = rel.id) - WHERE (isrenamed = 0 OR rel.categoryid = 8010) + INNER JOIN releasefiles relfiles ON (relfiles.releaseID = rel.ID) + WHERE (isrenamed = 0 OR rel.categoryID = 8010) AND proc_files = 0'; } @@ -217,10 +217,10 @@ class NameFixer $this->_echoStartMessage($time, 'par2 files'); if ($cats === 3) { - $query = 'SELECT rel.id AS releaseid, rel.guid, rel.groupid FROM releases rel WHERE nzbstatus = 1 AND prehashid = 0'; + $query = 'SELECT rel.ID AS releaseID, rel.guid, rel.groupID FROM releases rel WHERE nzbstatus = 1 AND prehashID = 0'; $cats = 2; } else { - $query = 'SELECT rel.id AS releaseid, rel.guid, rel.groupid FROM releases rel WHERE (isrenamed = 0 OR rel.categoryid = 8010) AND proc_par2 = 0'; + $query = 'SELECT rel.ID AS releaseID, rel.guid, rel.groupID FROM releases rel WHERE (isrenamed = 0 OR rel.categoryID = 8010) AND proc_par2 = 0'; } $releases = $this->_getReleases($time, $cats, $query); @@ -242,7 +242,7 @@ class NameFixer ); foreach ($releases as $release) { - if (($nzbContents->checkPAR2($release['guid'], $release['releaseid'], $release['groupid'], $nameStatus, $show)) === true) { + if (($nzbContents->checkPAR2($release['guid'], $release['releaseid'], $release['groupID'], $nameStatus, $show)) === true) { $this->fixed++; } @@ -368,9 +368,9 @@ class NameFixer $newName = $releaseCleaning->fixerCleaner($name); if (strtolower($newName) != strtolower($release["searchname"])) { $this->matched = true; - $this->relid = $release["releaseid"]; + $this->relid = $release["releaseID"]; - $determinedCategory = $this->category->determineCategory($release['groupid'], $newName); + $determinedCategory = $this->category->determineCategory($release['groupID'], $newName); if ($type === "PAR2, ") { $newName = ucwords($newName); @@ -385,9 +385,9 @@ class NameFixer $newName = preg_replace(array('/^[-=_\.:\s]+/', '/[-=_\.:\s]+$/'), '', $newName[0]); if ($this->echooutput === true && $show === 1) { - $groupName = $this->functions->getByNameByid($release['groupid']); - $oldCatName = $this->functions->getNameByid($release['categoryid']); - $newCatName = $this->functions->getNameByid($determinedCategory); + $groupName = $this->functions->getByNameByID($release['groupID']); + $oldCatName = $this->functions->getNameByID($release['categoryID']); + $newCatName = $this->functions->getNameByID($determinedCategory); if ($type === "PAR2, ") { echo PHP_EOL; @@ -408,7 +408,7 @@ class NameFixer $this->c->primary($groupName) . $this->c->headerOver("Method: ") . $this->c->primary($type . $method) . - $this->c->headerOver("Releaseid: ") . + $this->c->headerOver("ReleaseID: ") . $this->c->primary($release["releaseid"]); if (isset($release['filename']) && $release['filename'] != ""){ echo @@ -439,10 +439,10 @@ class NameFixer sprintf(' UPDATE releases SET rageid = -1, seriesfull = NULL, season = NULL, episode = NULL, - tvtitle = NULL, tvairdate = NULL, imdbid = NULL, musicinfoid = NULL, - consoleinfoid = NULL, bookinfoid = NULL, anidbid = NULL, prehashid = %s, - searchname = %s, %s categoryid = %d - WHERE id = %d', + tvtitle = NULL, tvairdate = NULL, imdbID = NULL, musicinfoID = NULL, + consoleinfoID = NULL, bookinfoID = NULL, anidbID = NULL, prehashID = %s, + searchname = %s, %s categoryID = %d + WHERE ID = %d', $preId, $this->db->escapeString(substr($newName, 0, 255)), $status, @@ -455,10 +455,10 @@ class NameFixer sprintf(' UPDATE releases SET rageid = -1, seriesfull = NULL, season = NULL, episode = NULL, - tvtitle = NULL, tvairdate = NULL, imdbid = NULL, musicinfoid = NULL, - consoleinfoid = NULL, bookinfoid = NULL, anidbid = NULL, prehashid = %s, - searchname = %s, iscategorized = 1, categoryid = %d - WHERE id = %d', + tvtitle = NULL, tvairdate = NULL, imdbID = NULL, musicinfoID = NULL, + consoleinfoID = NULL, bookinfoID = NULL, anidbID = NULL, prehashID = %s, + searchname = %s, iscategorized = 1, categoryID = %d + WHERE ID = %d', $preId, $this->db->escapeString(substr($newName, 0, 255)), $determinedCategory, @@ -485,7 +485,7 @@ class NameFixer $titlematch = '+"' . implode('" +"', $matches[0]) . '"'; //Find release matches with fulltext and then identify exact matches with cleaned LIKE string - $res = $db->queryDirect(sprintf("SELECT rs.releaseid AS releaseid FROM releasesearch rs + $res = $db->queryDirect(sprintf("SELECT rs.releaseID AS releaseid FROM releasesearch rs WHERE MATCH (rs.name, rs.searchname) AGAINST ('%s' IN BOOLEAN MODE) AND (rs.name LIKE %s OR rs.searchname LIKE %s) LIMIT 16", $titlematch, $db->escapeString($titlelike), $db->escapeString($titlelike) @@ -501,22 +501,22 @@ class NameFixer // Run if row count is positive, but do not run if row count exceeds 10 (as this is likely a failed title match) if ($total > 0 && $total <= 15) { foreach ($res as $row) { - $release = $db->queryOneRow(sprintf("SELECT id AS releaseid, name, searchname, groupid, categoryid FROM releases WHERE nzbstatus = 1 AND prehashid = 0 AND id = %d", $row['releaseid'])); + $release = $db->queryOneRow(sprintf("SELECT ID AS releaseid, name, searchname, groupID, categoryID FROM releases WHERE nzbstatus = 1 AND prehashID = 0 AND ID = %d", $row['releaseID'])); if ($release !== false) { - $db->exec(sprintf("UPDATE releases SET prehashid = %d WHERE id = %d", $pre['prehashid'], $release['releaseid'])); + $db->exec(sprintf("UPDATE releases SET prehashID = %d WHERE ID = %d", $pre['prehashID'], $release['releaseid'])); if ($pre['title'] !== $release['searchname']) { - $determinedcat = $this->category->determineCategory($release['groupid'], $pre['title']); + $determinedcat = $this->category->determineCategory($release['groupID'], $pre['title']); if ($echo == 1) { $this->matched = true; if ($namestatus == 1) { - $db->exec(sprintf("UPDATE releases SET rageid = -1, seriesfull = NULL, season = NULL, episode = NULL, tvtitle = NULL, tvairdate = NULL, imdbid = NULL, musicinfoid = NULL, consoleinfoid = NULL, bookinfoid = NULL, anidbid = NULL, " - . "searchname = %s, categoryid = %d, isrenamed = 1, iscategorized = 1 WHERE id = %d", $db->escapeString($pre['title']), $determinedcat, $release['releaseid'] + $db->exec(sprintf("UPDATE releases SET rageID = -1, seriesfull = NULL, season = NULL, episode = NULL, tvtitle = NULL, tvairdate = NULL, imdbID = NULL, musicinfoID = NULL, consoleinfoID = NULL, bookinfoID = NULL, anidbID = NULL, " + . "searchname = %s, categoryID = %d, isrenamed = 1, iscategorized = 1 WHERE ID = %d", $db->escapeString($pre['title']), $determinedcat, $release['releaseid'] ) ); } else { - $db->exec(sprintf("UPDATE releases SET rageid = -1, seriesfull = NULL, season = NULL, episode = NULL, tvtitle = NULL, tvairdate = NULL, imdbid = NULL, musicinfoid = NULL, consoleinfoid = NULL, bookinfoid = NULL, anidbid = NULL, " - . "searchname = %s, categoryid = %d WHERE id = %d", $db->escapeString($pre['title']), $determinedcat, $release['releaseid'] + $db->exec(sprintf("UPDATE releases SET rageID = -1, seriesfull = NULL, season = NULL, episode = NULL, tvtitle = NULL, tvairdate = NULL, imdbID = NULL, musicinfoID = NULL, consoleinfoID = NULL, bookinfoID = NULL, anIDbID = NULL, " + . "searchname = %s, categoryID = %d WHERE ID = %d", $db->escapeString($pre['title']), $determinedcat, $release['releaseid'] ) ); } @@ -549,7 +549,7 @@ class NameFixer $column = sprintf("filename = %s", $db->escapeString($release['filename'])); } - $res = $db->queryDirect(sprintf("SELECT id AS prehashid, title, source FROM prehash WHERE %s", $column)); + $res = $db->queryDirect(sprintf("SELECT ID AS prehashID, title, source FROM prehash WHERE %s", $column)); if ($res !== false) { $total = $res->rowCount(); @@ -560,21 +560,21 @@ class NameFixer if ($total > 0) { foreach ($res as $pre) { if ($echo == 1) { - $db->exec(sprintf("UPDATE releases SET prehashid = %d WHERE id = %d", $pre['prehashid'], $release['releaseid'])); + $db->exec(sprintf("UPDATE releases SET prehashID = %d WHERE ID = %d", $pre['prehashID'], $release['releaseid'])); } if ($pre['title'] !== $release['searchname']) { - $determinedcat = $this->category->determineCategory($release['groupid'], $pre['title']); + $determinedcat = $this->category->determineCategory($release['groupID'], $pre['title']); if ($echo == 1) { $this->matched = true; if ($namestatus == 1) { - $db->exec(sprintf("UPDATE releases SET rageid = -1, seriesfull = NULL, season = NULL, episode = NULL, tvtitle = NULL, tvairdate = NULL, imdbid = NULL, musicinfoid = NULL, consoleinfoid = NULL, bookinfoid = NULL, anidbid = NULL, " - . "searchname = %s, categoryid = %d, isrenamed = 1, iscategorized = 1 WHERE id = %d", $db->escapeString($pre['title']), $determinedcat, $release['releaseid'] + $db->exec(sprintf("UPDATE releases SET rageID = -1, seriesfull = NULL, season = NULL, episode = NULL, tvtitle = NULL, tvairdate = NULL, imdbID = NULL, musicinfoID = NULL, consoleinfoID = NULL, bookinfoID = NULL, anidbID = NULL, " + . "searchname = %s, categoryID = %d, isrenamed = 1, iscategorized = 1 WHERE ID = %d", $db->escapeString($pre['title']), $determinedcat, $release['releaseid'] ) ); } else { - $db->exec(sprintf("UPDATE releases SET rageid = -1, seriesfull = NULL, season = NULL, episode = NULL, tvtitle = NULL, tvairdate = NULL, imdbid = NULL, musicinfoid = NULL, consoleinfoid = NULL, bookinfoid = NULL, anidbid = NULL, " - . "searchname = %s, categoryid = %d WHERE id = %d", $db->escapeString($pre['title']), $determinedcat, $release['releaseid'] + $db->exec(sprintf("UPDATE releases SET rageID = -1, seriesfull = NULL, season = NULL, episode = NULL, tvtitle = NULL, tvairdate = NULL, imdbID = NULL, musicinfoID = NULL, consoleinfoID = NULL, bookinfoID = NULL, anidbID = NULL, " + . "searchname = %s, categoryID = %d WHERE ID = %d", $db->escapeString($pre['title']), $determinedcat, $release['releaseid'] ) ); } @@ -605,7 +605,7 @@ class NameFixer $hashtype = "MD5, "; } - $res = $db->queryDirect(sprintf("SELECT id AS prehashid, title, source FROM pre inner join predbhash on predbhash.pre_id = prehash.id WHERE MATCH (predbhash.hashes) AGAINST (%s)", $db->escapeString(strtolower($hash)))); + $res = $db->queryDirect(sprintf("SELECT ID AS prehashID, title, source FROM pre inner join predbhash on predbhash.pre_id = prehash.ID WHERE MATCH (predbhash.hashes) AGAINST (%s)", $db->escapeString(strtolower($hash)))); if ($res !== false) { $total = $res->rowCount(); @@ -615,20 +615,20 @@ class NameFixer if ($total > 0) { foreach ($res as $row) { - $db->exec(sprintf("UPDATE releases SET prehashid = %d WHERE id = %d", $row['prehashid'], $release['releaseid'])); + $db->exec(sprintf("UPDATE releases SET prehashID = %d WHERE ID = %d", $row['prehashID'], $release['releaseid'])); if ($row["title"] !== $release["searchname"]) { - $determinedcat = $this->category->determineCategory($release["groupid"], $row["title"]); + $determinedcat = $this->category->determineCategory($release["groupID"], $row["title"]); if ($echo == 1) { $this->matched = true; if ($namestatus == 1) { - $db->exec(sprintf("UPDATE releases SET rageid = -1, seriesfull = NULL, season = NULL, episode = NULL, tvtitle = NULL, tvairdate = NULL, imdbid = NULL, musicinfoid = NULL, condoleinfoid = NULL, bookinfoid = NULL, anidbid = NULL, " - . "searchname = %s, categoryid = %d, isrenamed = 1, iscategorized = 1, dehashstatus = 1 WHERE id = %d", $db->escapeString($row["title"]), $determinedcat, $release["releaseid"] + $db->exec(sprintf("UPDATE releases SET rageID = -1, seriesfull = NULL, season = NULL, episode = NULL, tvtitle = NULL, tvairdate = NULL, imdbID = NULL, musicinfoID = NULL, condoleinfoID = NULL, bookinfoID = NULL, anidbID = NULL, " + . "searchname = %s, categoryID = %d, isrenamed = 1, iscategorized = 1, dehashstatus = 1 WHERE ID = %d", $db->escapeString($row["title"]), $determinedcat, $release["releaseID"] ) ); } else { - $db->exec(sprintf("UPDATE releases SET rageid = -1, seriesfull = NULL, season = NULL, episode = NULL, tvtitle = NULL, tvairdate = NULL, imdbid = NULL, musicinfoid = NULL, condoleinfoid = NULL, bookinfoid = NULL, anidbid = NULL, " - . "searchname = %s, categoryid = %d, dehashstatus = 1 WHERE id = %d", $db->escapeString($row["title"]), $determinedcat, $release["releaseid"] + $db->exec(sprintf("UPDATE releases SET rageid = -1, seriesfull = NULL, season = NULL, episode = NULL, tvtitle = NULL, tvairdate = NULL, imdbID = NULL, musicinfoID = NULL, condoleinfoID = NULL, bookinfoID = NULL, anidbID = NULL, " + . "searchname = %s, categoryID = %d, dehashstatus = 1 WHERE ID = %d", $db->escapeString($row["title"]), $determinedcat, $release["releaseid"] ) ); } @@ -641,7 +641,7 @@ class NameFixer } } } else { - $db->exec(sprintf("UPDATE releases SET dehashstatus = %d - 1 WHERE id = %d", $release['dehashstatus'], $release['releaseid'])); + $db->exec(sprintf("UPDATE releases SET dehashstatus = %d - 1 WHERE ID = %d", $release['dehashstatus'], $release['releaseid'])); //echo "."; } @@ -655,15 +655,15 @@ class NameFixer if (preg_match_all('/([\w\(\)]+[\s\._-]([\w\(\)]+[\s\._-])+[\w\(\)]+-\w+)/', $release['textstring'], $matches)) { foreach ($matches as $match) { foreach ($match as $val) { - $title = $this->db->queryOneRow("SELECT title, id from prehash WHERE title = " . $this->db->escapeString(trim($val))); + $title = $this->db->queryOneRow("SELECT title, ID from prehash WHERE title = " . $this->db->escapeString(trim($val))); if ($title !== false) { - $this->updateRelease($release, $title['title'], $method = "preDB: Match", $echo, $type, $namestatus, $show, $title['id']); + $this->updateRelease($release, $title['title'], $method = "preDB: Match", $echo, $type, $namestatus, $show, $title['ID']); } } } } - // if processing prehashid on filename, do not continue + // if processing prehashID on filename, do not continue if ($preid === true) { return false; } @@ -691,15 +691,15 @@ class NameFixer // The release didn't match so set proc_nfo = 1 so it doesn't get rechecked. Also allows removeCrapReleases to run extra things on the release. if ($namestatus == 1 && $this->matched === false && $type == "NFO, ") { $db = $this->db; - $db->exec(sprintf("UPDATE releases SET proc_nfo = 1 WHERE id = %d", $release["releaseid"])); + $db->exec(sprintf("UPDATE releases SET proc_nfo = 1 WHERE ID = %d", $release["releaseid"])); } // The release didn't match so set proc_files = 1 so it doesn't get rechecked. Also allows removeCrapReleases to run extra things on the release. else if ($namestatus == 1 && $this->matched === false && $type == "Filenames, ") { $db = $this->db; - $db->exec(sprintf("UPDATE releases SET proc_files = 1 WHERE id = %d", $release["releaseid"])); + $db->exec(sprintf("UPDATE releases SET proc_files = 1 WHERE ID = %d", $release["releaseid"])); } // The release didn't match so set proc_par2 = 1 so it doesn't get rechecked. Also allows removeCrapReleases to run extra things on the release. else if ($namestatus == 1 && $this->matched === false && $type == "PAR2, ") { $db = $this->db; - $db->exec(sprintf("UPDATE releases SET proc_par2 = 1 WHERE id = %d", $release["releaseid"])); + $db->exec(sprintf("UPDATE releases SET proc_par2 = 1 WHERE ID = %d", $release["releaseid"])); } return $this->matched; @@ -709,21 +709,21 @@ class NameFixer public function tvCheck($release, $echo, $type, $namestatus, $show) { $result = ''; - if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\w[-\w.\',;& ]+((s\d{1,2}[._ -]?[bde]\d{1,2})|(?done === false && $this->relid !== $release["releaseID"] && preg_match('/\w[-\w.\',;& ]+((s\d{1,2}[._ -]?[bde]\d{1,2})|(?updateRelease($release, $result["0"], $method = "tvCheck: Title.SxxExx.Text.source.group", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\w[-\w.\',;& ]+((s\d{1,2}[._ -]?[bde]\d{1,2})|\d{1,2}x\d{2}|ep[._ -]?\d{2})[-\w.\',;& ]+((19|20)\d\d)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\w[-\w.\',;& ]+((s\d{1,2}[._ -]?[bde]\d{1,2})|\d{1,2}x\d{2}|ep[._ -]?\d{2})[-\w.\',;& ]+((19|20)\d\d)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["0"], $method = "tvCheck: Title.SxxExx.Text.year.group", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\w[-\w.\',;& ]+((s\d{1,2}[._ -]?[bde]\d{1,2})|\d{1,2}x\d{2}|ep[._ -]?\d{2})[-\w.\',;& ]+(480|720|1080)[ip][._ -](BD(-?(25|50|RIP))?|Blu-?Ray ?(3D)?|BRRIP|CAM(RIP)?|DBrip|DTV|DVD\-?(5|9|(R(IP)?|scr(eener)?))?|[HPS]D?(RIP|TV(RIP)?)?|NTSC|PAL|R5|Ripped |S?VCD|scr(eener)?|SAT(RIP)?|TS|VHS(RIP)?|VOD|WEB-DL)[._ -](DivX|[HX][._ -]?264|MPEG2|XviD(HD)?|WMV)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\w[-\w.\',;& ]+((s\d{1,2}[._ -]?[bde]\d{1,2})|\d{1,2}x\d{2}|ep[._ -]?\d{2})[-\w.\',;& ]+(480|720|1080)[ip][._ -](BD(-?(25|50|RIP))?|Blu-?Ray ?(3D)?|BRRIP|CAM(RIP)?|DBrip|DTV|DVD\-?(5|9|(R(IP)?|scr(eener)?))?|[HPS]D?(RIP|TV(RIP)?)?|NTSC|PAL|R5|Ripped |S?VCD|scr(eener)?|SAT(RIP)?|TS|VHS(RIP)?|VOD|WEB-DL)[._ -](DivX|[HX][._ -]?264|MPEG2|XviD(HD)?|WMV)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["0"], $method = "tvCheck: Title.SxxExx.Text.resolution.source.vcodec.group", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\w[-\w.\',;& ]+((s\d{1,2}[._ -]?[bde]\d{1,2})|\d{1,2}x\d{2}|ep[._ -]?\d{2})[._ -](BD(-?(25|50|RIP))?|Blu-?Ray ?(3D)?|BRRIP|CAM(RIP)?|DBrip|DTV|DVD\-?(5|9|(R(IP)?|scr(eener)?))?|[HPS]D?(RIP|TV(RIP)?)?|NTSC|PAL|R5|Ripped |S?VCD|scr(eener)?|SAT(RIP)?|TS|VHS(RIP)?|VOD|WEB-DL)[._ -](DivX|[HX][._ -]?264|MPEG2|XviD(HD)?|WMV)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\w[-\w.\',;& ]+((s\d{1,2}[._ -]?[bde]\d{1,2})|\d{1,2}x\d{2}|ep[._ -]?\d{2})[._ -](BD(-?(25|50|RIP))?|Blu-?Ray ?(3D)?|BRRIP|CAM(RIP)?|DBrip|DTV|DVD\-?(5|9|(R(IP)?|scr(eener)?))?|[HPS]D?(RIP|TV(RIP)?)?|NTSC|PAL|R5|Ripped |S?VCD|scr(eener)?|SAT(RIP)?|TS|VHS(RIP)?|VOD|WEB-DL)[._ -](DivX|[HX][._ -]?264|MPEG2|XviD(HD)?|WMV)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["0"], $method = "tvCheck: Title.SxxExx.source.vcodec.group", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\w[-\w.\',;& ]+((s\d{1,2}[._ -]?[bde]\d{1,2})|\d{1,2}x\d{2}|ep[._ -]?\d{2})[._ -](AAC( LC)?|AC-?3|DD5([._ -]1)?|(A_)?DTS-?(HD)?|Dolby( ?TrueHD)?|MP3|TrueHD)[._ -](BD(-?(25|50|RIP))?|Blu-?Ray ?(3D)?|BRRIP|CAM(RIP)?|DBrip|DTV|DVD\-?(5|9|(R(IP)?|scr(eener)?))?|[HPS]D?(RIP|TV(RIP)?)?|NTSC|PAL|R5|Ripped |S?VCD|scr(eener)?|SAT(RIP)?|TS|VHS(RIP)?|VOD|WEB-DL)[._ -](480|720|1080)[ip][._ -](DivX|[HX][._ -]?264|MPEG2|XviD(HD)?|WMV)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\w[-\w.\',;& ]+((s\d{1,2}[._ -]?[bde]\d{1,2})|\d{1,2}x\d{2}|ep[._ -]?\d{2})[._ -](AAC( LC)?|AC-?3|DD5([._ -]1)?|(A_)?DTS-?(HD)?|Dolby( ?TrueHD)?|MP3|TrueHD)[._ -](BD(-?(25|50|RIP))?|Blu-?Ray ?(3D)?|BRRIP|CAM(RIP)?|DBrip|DTV|DVD\-?(5|9|(R(IP)?|scr(eener)?))?|[HPS]D?(RIP|TV(RIP)?)?|NTSC|PAL|R5|Ripped |S?VCD|scr(eener)?|SAT(RIP)?|TS|VHS(RIP)?|VOD|WEB-DL)[._ -](480|720|1080)[ip][._ -](DivX|[HX][._ -]?264|MPEG2|XviD(HD)?|WMV)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["0"], $method = "tvCheck: Title.SxxExx.acodec.source.res.vcodec.group", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\w[-\w.\',;& ]+((s\d{1,2}[._ -]?[bde]\d{1,2})|\d{1,2}x\d{2}|ep[._ -]?\d{2})[-\w.\',;& ]+((19|20)\d\d)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\w[-\w.\',;& ]+((s\d{1,2}[._ -]?[bde]\d{1,2})|\d{1,2}x\d{2}|ep[._ -]?\d{2})[-\w.\',;& ]+((19|20)\d\d)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["0"], $method = "tvCheck: Title.SxxExx.resolution.source.vcodec.group", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\w[-\w.\',;& ]+((19|20)\d\d)[._ -]((s\d{1,2}[._ -]?[bde]\d{1,2})|\d{1,2}x\d{2}|ep[._ -]?\d{2})[._ -](BD(-?(25|50|RIP))?|Blu-?Ray ?(3D)?|BRRIP|CAM(RIP)?|DBrip|DTV|DVD\-?(5|9|(R(IP)?|scr(eener)?))?|[HPS]D?(RIP|TV(RIP)?)?|NTSC|PAL|R5|Ripped |S?VCD|scr(eener)?|SAT(RIP)?|TS|VHS(RIP)?|VOD|WEB-DL)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\w[-\w.\',;& ]+((19|20)\d\d)[._ -]((s\d{1,2}[._ -]?[bde]\d{1,2})|\d{1,2}x\d{2}|ep[._ -]?\d{2})[._ -](BD(-?(25|50|RIP))?|Blu-?Ray ?(3D)?|BRRIP|CAM(RIP)?|DBrip|DTV|DVD\-?(5|9|(R(IP)?|scr(eener)?))?|[HPS]D?(RIP|TV(RIP)?)?|NTSC|PAL|R5|Ripped |S?VCD|scr(eener)?|SAT(RIP)?|TS|VHS(RIP)?|VOD|WEB-DL)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["0"], $method = "tvCheck: Title.year.###(season/episode).source.group", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\w(19|20)\d\d[._ -]\d{2}[._ -]\d{2}[._ -](IndyCar|NBA|NCW(T|Y)S|NNS|NSCS?)([._ -](19|20)\d\d)?[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\w(19|20)\d\d[._ -]\d{2}[._ -]\d{2}[._ -](IndyCar|NBA|NCW(T|Y)S|NNS|NSCS?)([._ -](19|20)\d\d)?[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["0"], $method = "tvCheck: Sports", $echo, $type, $namestatus, $show); } } @@ -732,31 +732,31 @@ class NameFixer public function movieCheck($release, $echo, $type, $namestatus, $show) { $result = ''; - if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\w[-\w.\',;& ]+((19|20)\d\d)[-\w.\',;& ]+(480|720|1080)[ip][._ -](DivX|[HX][._ -]?264|MPEG2|XviD(HD)?|WMV)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { + if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\w[-\w.\',;& ]+((19|20)\d\d)[-\w.\',;& ]+(480|720|1080)[ip][._ -](DivX|[HX][._ -]?264|MPEG2|XviD(HD)?|WMV)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["0"], $method = "movieCheck: Title.year.Text.res.vcod.group", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\w[-\w.\',;& ]+((19|20)\d\d)[._ -](BD(-?(25|50|RIP))?|Blu-?Ray ?(3D)?|BRRIP|CAM(RIP)?|DBrip|DTV|DVD\-?(5|9|(R(IP)?|scr(eener)?))?|[HPS]D?(RIP|TV(RIP)?)?|NTSC|PAL|R5|Ripped |S?VCD|scr(eener)?|SAT(RIP)?|TS|VHS(RIP)?|VOD|WEB-DL)[._ -](DivX|[HX][._ -]?264|MPEG2|XviD(HD)?|WMV)[._ -](480|720|1080)[ip][-\w.\',;& ]+\w/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\w[-\w.\',;& ]+((19|20)\d\d)[._ -](BD(-?(25|50|RIP))?|Blu-?Ray ?(3D)?|BRRIP|CAM(RIP)?|DBrip|DTV|DVD\-?(5|9|(R(IP)?|scr(eener)?))?|[HPS]D?(RIP|TV(RIP)?)?|NTSC|PAL|R5|Ripped |S?VCD|scr(eener)?|SAT(RIP)?|TS|VHS(RIP)?|VOD|WEB-DL)[._ -](DivX|[HX][._ -]?264|MPEG2|XviD(HD)?|WMV)[._ -](480|720|1080)[ip][-\w.\',;& ]+\w/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["0"], $method = "movieCheck: Title.year.source.vcodec.res.group", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\w[-\w.\',;& ]+((19|20)\d\d)[._ -](BD(-?(25|50|RIP))?|Blu-?Ray ?(3D)?|BRRIP|CAM(RIP)?|DBrip|DTV|DVD\-?(5|9|(R(IP)?|scr(eener)?))?|[HPS]D?(RIP|TV(RIP)?)?|NTSC|PAL|R5|Ripped |S?VCD|scr(eener)?|SAT(RIP)?|TS|VHS(RIP)?|VOD|WEB-DL)[._ -](DivX|[HX][._ -]?264|MPEG2|XviD(HD)?|WMV)[._ -](AAC( LC)?|AC-?3|DD5([._ -]1)?|(A_)?DTS-?(HD)?|Dolby( ?TrueHD)?|MP3|TrueHD)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\w[-\w.\',;& ]+((19|20)\d\d)[._ -](BD(-?(25|50|RIP))?|Blu-?Ray ?(3D)?|BRRIP|CAM(RIP)?|DBrip|DTV|DVD\-?(5|9|(R(IP)?|scr(eener)?))?|[HPS]D?(RIP|TV(RIP)?)?|NTSC|PAL|R5|Ripped |S?VCD|scr(eener)?|SAT(RIP)?|TS|VHS(RIP)?|VOD|WEB-DL)[._ -](DivX|[HX][._ -]?264|MPEG2|XviD(HD)?|WMV)[._ -](AAC( LC)?|AC-?3|DD5([._ -]1)?|(A_)?DTS-?(HD)?|Dolby( ?TrueHD)?|MP3|TrueHD)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["0"], $method = "movieCheck: Title.year.source.vcodec.acodec.group", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\w[-\w.\',;& ]+(Brazilian|Chinese|Croatian|Danish|Deutsch|Dutch|Estonian|English|Finnish|Flemish|Francais|French|German|Greek|Hebrew|Icelandic|Italian|Japenese|Japan|Japanese|Korean|Latin|Nordic|Norwegian|Polish|Portuguese|Russian|Serbian|Slovenian|Swedish|Spanisch|Spanish|Thai|Turkish)[._ -](AAC( LC)?|AC-?3|DD5([._ -]1)?|(A_)?DTS-?(HD)?|Dolby( ?TrueHD)?|MP3|TrueHD)[._ -](BD(-?(25|50|RIP))?|Blu-?Ray ?(3D)?|BRRIP|CAM(RIP)?|DBrip|DTV|DVD\-?(5|9|(R(IP)?|scr(eener)?))?|[HPS]D?(RIP|TV(RIP)?)?|NTSC|PAL|R5|Ripped |S?VCD|scr(eener)?|SAT(RIP)?|TS|VHS(RIP)?|VOD|WEB-DL)[._ -](DivX|[HX][._ -]?264|MPEG2|XviD(HD)?|WMV)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\w[-\w.\',;& ]+(Brazilian|Chinese|Croatian|Danish|Deutsch|Dutch|Estonian|English|Finnish|Flemish|Francais|French|German|Greek|Hebrew|Icelandic|Italian|Japenese|Japan|Japanese|Korean|Latin|Nordic|Norwegian|Polish|Portuguese|Russian|Serbian|Slovenian|Swedish|Spanisch|Spanish|Thai|Turkish)[._ -](AAC( LC)?|AC-?3|DD5([._ -]1)?|(A_)?DTS-?(HD)?|Dolby( ?TrueHD)?|MP3|TrueHD)[._ -](BD(-?(25|50|RIP))?|Blu-?Ray ?(3D)?|BRRIP|CAM(RIP)?|DBrip|DTV|DVD\-?(5|9|(R(IP)?|scr(eener)?))?|[HPS]D?(RIP|TV(RIP)?)?|NTSC|PAL|R5|Ripped |S?VCD|scr(eener)?|SAT(RIP)?|TS|VHS(RIP)?|VOD|WEB-DL)[._ -](DivX|[HX][._ -]?264|MPEG2|XviD(HD)?|WMV)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["0"], $method = "movieCheck: Title.year.language.acodec.source.vcodec.group", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\w[-\w.\',;& ]+((19|20)\d\d)[._ -](480|720|1080)[ip][._ -](BD(-?(25|50|RIP))?|Blu-?Ray ?(3D)?|BRRIP|CAM(RIP)?|DBrip|DTV|DVD\-?(5|9|(R(IP)?|scr(eener)?))?|[HPS]D?(RIP|TV(RIP)?)?|NTSC|PAL|R5|Ripped |S?VCD|scr(eener)?|SAT(RIP)?|TS|VHS(RIP)?|VOD|WEB-DL)[._ -](AAC( LC)?|AC-?3|DD5([._ -]1)?|(A_)?DTS-?(HD)?|Dolby( ?TrueHD)?|MP3|TrueHD)[._ -](DivX|[HX][._ -]?264|MPEG2|XviD(HD)?|WMV)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\w[-\w.\',;& ]+((19|20)\d\d)[._ -](480|720|1080)[ip][._ -](BD(-?(25|50|RIP))?|Blu-?Ray ?(3D)?|BRRIP|CAM(RIP)?|DBrip|DTV|DVD\-?(5|9|(R(IP)?|scr(eener)?))?|[HPS]D?(RIP|TV(RIP)?)?|NTSC|PAL|R5|Ripped |S?VCD|scr(eener)?|SAT(RIP)?|TS|VHS(RIP)?|VOD|WEB-DL)[._ -](AAC( LC)?|AC-?3|DD5([._ -]1)?|(A_)?DTS-?(HD)?|Dolby( ?TrueHD)?|MP3|TrueHD)[._ -](DivX|[HX][._ -]?264|MPEG2|XviD(HD)?|WMV)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["0"], $method = "movieCheck: Title.year.resolution.source.acodec.vcodec.group", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\w[-\w.\',;& ]+((19|20)\d\d)[._ -](480|720|1080)[ip][._ -](BD(-?(25|50|RIP))?|Blu-?Ray ?(3D)?|BRRIP|CAM(RIP)?|DBrip|DTV|DVD\-?(5|9|(R(IP)?|scr(eener)?))?|[HPS]D?(RIP|TV(RIP)?)?|NTSC|PAL|R5|Ripped |S?VCD|scr(eener)?|SAT(RIP)?|TS|VHS(RIP)?|VOD|WEB-DL)[._ -](DivX|[HX][._ -]?264|MPEG2|XviD(HD)?|WMV)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\w[-\w.\',;& ]+((19|20)\d\d)[._ -](480|720|1080)[ip][._ -](BD(-?(25|50|RIP))?|Blu-?Ray ?(3D)?|BRRIP|CAM(RIP)?|DBrip|DTV|DVD\-?(5|9|(R(IP)?|scr(eener)?))?|[HPS]D?(RIP|TV(RIP)?)?|NTSC|PAL|R5|Ripped |S?VCD|scr(eener)?|SAT(RIP)?|TS|VHS(RIP)?|VOD|WEB-DL)[._ -](DivX|[HX][._ -]?264|MPEG2|XviD(HD)?|WMV)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["0"], $method = "movieCheck: Title.year.resolution.source.vcodec.group", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\w[-\w.\',;& ]+((19|20)\d\d)[._ -](BD(-?(25|50|RIP))?|Blu-?Ray ?(3D)?|BRRIP|CAM(RIP)?|DBrip|DTV|DVD\-?(5|9|(R(IP)?|scr(eener)?))?|[HPS]D?(RIP|TV(RIP)?)?|NTSC|PAL|R5|Ripped |S?VCD|scr(eener)?|SAT(RIP)?|TS|VHS(RIP)?|VOD|WEB-DL)[._ -](480|720|1080)[ip][._ -](AAC( LC)?|AC-?3|DD5([._ -]1)?|(A_)?DTS-?(HD)?|Dolby( ?TrueHD)?|MP3|TrueHD)[._ -](DivX|[HX][._ -]?264|MPEG2|XviD(HD)?|WMV)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\w[-\w.\',;& ]+((19|20)\d\d)[._ -](BD(-?(25|50|RIP))?|Blu-?Ray ?(3D)?|BRRIP|CAM(RIP)?|DBrip|DTV|DVD\-?(5|9|(R(IP)?|scr(eener)?))?|[HPS]D?(RIP|TV(RIP)?)?|NTSC|PAL|R5|Ripped |S?VCD|scr(eener)?|SAT(RIP)?|TS|VHS(RIP)?|VOD|WEB-DL)[._ -](480|720|1080)[ip][._ -](AAC( LC)?|AC-?3|DD5([._ -]1)?|(A_)?DTS-?(HD)?|Dolby( ?TrueHD)?|MP3|TrueHD)[._ -](DivX|[HX][._ -]?264|MPEG2|XviD(HD)?|WMV)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["0"], $method = "movieCheck: Title.year.source.resolution.acodec.vcodec.group", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\w[-\w.\',;& ]+((19|20)\d\d)[._ -](480|720|1080)[ip][._ -](AAC( LC)?|AC-?3|DD5([._ -]1)?|(A_)?DTS-?(HD)?|Dolby( ?TrueHD)?|MP3|TrueHD)[._ -](DivX|[HX][._ -]?264|MPEG2|XviD(HD)?|WMV)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\w[-\w.\',;& ]+((19|20)\d\d)[._ -](480|720|1080)[ip][._ -](AAC( LC)?|AC-?3|DD5([._ -]1)?|(A_)?DTS-?(HD)?|Dolby( ?TrueHD)?|MP3|TrueHD)[._ -](DivX|[HX][._ -]?264|MPEG2|XviD(HD)?|WMV)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["0"], $method = "movieCheck: Title.year.resolution.acodec.vcodec.group", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/[-\w.\',;& ]+((19|20)\d\d)[._ -](BD(-?(25|50|RIP))?|Blu-?Ray ?(3D)?|BR(RIP)?|CAM(RIP)?|DBrip|DTV|DVD\-?(5|9|(R(IP)?|scr(eener)?))?|[HPS]D?(RIP|TV(RIP)?)?|NTSC|PAL|R5|Ripped |S?VCD|scr(eener)?|SAT(RIP)?|TS|VHS(RIP)?|VOD|WEB-DL)[._ -](480|720|1080)[ip][._ -][-\w.\',;& ]+\w/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/[-\w.\',;& ]+((19|20)\d\d)[._ -](BD(-?(25|50|RIP))?|Blu-?Ray ?(3D)?|BR(RIP)?|CAM(RIP)?|DBrip|DTV|DVD\-?(5|9|(R(IP)?|scr(eener)?))?|[HPS]D?(RIP|TV(RIP)?)?|NTSC|PAL|R5|Ripped |S?VCD|scr(eener)?|SAT(RIP)?|TS|VHS(RIP)?|VOD|WEB-DL)[._ -](480|720|1080)[ip][._ -][-\w.\',;& ]+\w/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["0"], $method = "movieCheck: Title.year.source.res.group", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\w[-\w.\',;& ]+((19|20)\d\d)[._ -][-\w.\',;& ]+[._ -](BD(-?(25|50|RIP))?|Blu-?Ray ?(3D)?|BR(RIP)?|CAM(RIP)?|DBrip|DTV|DVD\-?(5|9|(R(IP)?|scr(eener)?))?|[HPS]D?(RIP|TV(RIP)?)?|NTSC|PAL|R5|Ripped |S?VCD|scr(eener)?|SAT(RIP)?|TS|VHS(RIP)?|VOD|WEB-DL)[._ -](DivX|[HX][._ -]?264|MPEG2|XviD(HD)?|WMV)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\w[-\w.\',;& ]+((19|20)\d\d)[._ -][-\w.\',;& ]+[._ -](BD(-?(25|50|RIP))?|Blu-?Ray ?(3D)?|BR(RIP)?|CAM(RIP)?|DBrip|DTV|DVD\-?(5|9|(R(IP)?|scr(eener)?))?|[HPS]D?(RIP|TV(RIP)?)?|NTSC|PAL|R5|Ripped |S?VCD|scr(eener)?|SAT(RIP)?|TS|VHS(RIP)?|VOD|WEB-DL)[._ -](DivX|[HX][._ -]?264|MPEG2|XviD(HD)?|WMV)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["0"], $method = "movieCheck: Title.year.eptitle.source.vcodec.group", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\w[-\w.\',;& ]+(480|720|1080)[ip][._ -](BD(-?(25|50|RIP))?|Blu-?Ray ?(3D)?|BRRIP|CAM(RIP)?|DBrip|DTV|DVD\-?(5|9|(R(IP)?|scr(eener)?))?|[HPS]D?(RIP|TV(RIP)?)?|NTSC|PAL|R5|Ripped |S?VCD|scr(eener)?|SAT(RIP)?|TS|VHS(RIP)?|VOD|WEB-DL)[._ -](AAC( LC)?|AC-?3|DD5([._ -]1)?|(A_)?DTS-?(HD)?|Dolby( ?TrueHD)?|MP3|TrueHD)[._ -](DivX|[HX][._ -]?264|MPEG2|XviD(HD)?|WMV)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\w[-\w.\',;& ]+(480|720|1080)[ip][._ -](BD(-?(25|50|RIP))?|Blu-?Ray ?(3D)?|BRRIP|CAM(RIP)?|DBrip|DTV|DVD\-?(5|9|(R(IP)?|scr(eener)?))?|[HPS]D?(RIP|TV(RIP)?)?|NTSC|PAL|R5|Ripped |S?VCD|scr(eener)?|SAT(RIP)?|TS|VHS(RIP)?|VOD|WEB-DL)[._ -](AAC( LC)?|AC-?3|DD5([._ -]1)?|(A_)?DTS-?(HD)?|Dolby( ?TrueHD)?|MP3|TrueHD)[._ -](DivX|[HX][._ -]?264|MPEG2|XviD(HD)?|WMV)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["0"], $method = "movieCheck: Title.resolution.source.acodec.vcodec.group", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\w[-\w.\',;& ]+(480|720|1080)[ip][._ -](AAC( LC)?|AC-?3|DD5([._ -]1)?|(A_)?DTS-?(HD)?|Dolby( ?TrueHD)?|MP3|TrueHD)[-\w.\',;& ]+(BD(-?(25|50|RIP))?|Blu-?Ray ?(3D)?|BRRIP|CAM(RIP)?|DBrip|DTV|DVD\-?(5|9|(R(IP)?|scr(eener)?))?|[HPS]D?(RIP|TV(RIP)?)?|NTSC|PAL|R5|Ripped |S?VCD|scr(eener)?|SAT(RIP)?|TS|VHS(RIP)?|VOD|WEB-DL)[._ -]((19|20)\d\d)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\w[-\w.\',;& ]+(480|720|1080)[ip][._ -](AAC( LC)?|AC-?3|DD5([._ -]1)?|(A_)?DTS-?(HD)?|Dolby( ?TrueHD)?|MP3|TrueHD)[-\w.\',;& ]+(BD(-?(25|50|RIP))?|Blu-?Ray ?(3D)?|BRRIP|CAM(RIP)?|DBrip|DTV|DVD\-?(5|9|(R(IP)?|scr(eener)?))?|[HPS]D?(RIP|TV(RIP)?)?|NTSC|PAL|R5|Ripped |S?VCD|scr(eener)?|SAT(RIP)?|TS|VHS(RIP)?|VOD|WEB-DL)[._ -]((19|20)\d\d)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["0"], $method = "movieCheck: Title.resolution.acodec.eptitle.source.year.group", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\w[-\w.\',;& ]+(Brazilian|Chinese|Croatian|Danish|Deutsch|Dutch|Estonian|English|Finnish|Flemish|Francais|French|German|Greek|Hebrew|Icelandic|Italian|Japenese|Japan|Japanese|Korean|Latin|Nordic|Norwegian|Polish|Portuguese|Russian|Serbian|Slovenian|Swedish|Spanisch|Spanish|Thai|Turkish)[._ -]((19|20)\d\d)[._ -](AAC( LC)?|AC-?3|DD5([._ -]1)?|(A_)?DTS-?(HD)?|Dolby( ?TrueHD)?|MP3|TrueHD)[._ -](BD(-?(25|50|RIP))?|Blu-?Ray ?(3D)?|BRRIP|CAM(RIP)?|DBrip|DTV|DVD\-?(5|9|(R(IP)?|scr(eener)?))?|[HPS]D?(RIP|TV(RIP)?)?|NTSC|PAL|R5|Ripped |S?VCD|scr(eener)?|SAT(RIP)?|TS|VHS(RIP)?|VOD|WEB-DL)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\w[-\w.\',;& ]+(Brazilian|Chinese|Croatian|Danish|Deutsch|Dutch|Estonian|English|Finnish|Flemish|Francais|French|German|Greek|Hebrew|Icelandic|Italian|Japenese|Japan|Japanese|Korean|Latin|Nordic|Norwegian|Polish|Portuguese|Russian|Serbian|Slovenian|Swedish|Spanisch|Spanish|Thai|Turkish)[._ -]((19|20)\d\d)[._ -](AAC( LC)?|AC-?3|DD5([._ -]1)?|(A_)?DTS-?(HD)?|Dolby( ?TrueHD)?|MP3|TrueHD)[._ -](BD(-?(25|50|RIP))?|Blu-?Ray ?(3D)?|BRRIP|CAM(RIP)?|DBrip|DTV|DVD\-?(5|9|(R(IP)?|scr(eener)?))?|[HPS]D?(RIP|TV(RIP)?)?|NTSC|PAL|R5|Ripped |S?VCD|scr(eener)?|SAT(RIP)?|TS|VHS(RIP)?|VOD|WEB-DL)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["0"], $method = "movieCheck: Title.language.year.acodec.src", $echo, $type, $namestatus, $show); } } @@ -765,14 +765,14 @@ class NameFixer public function gameCheck($release, $echo, $type, $namestatus, $show) { $result = ''; - if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\w[-\w.\',;& ]+(ASIA|DLC|EUR|GOTY|JPN|KOR|MULTI\d{1}|NTSCU?|PAL|RF|Region[._ -]?Free|USA|XBLA)[._ -](DLC[._ -]Complete|FRENCH|GERMAN|MULTI\d{1}|PROPER|PSN|READ[._ -]?NFO|UMD)?[._ -]?(GC|NDS|NGC|PS3|PSP|WII|XBOX(360)?)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { + if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\w[-\w.\',;& ]+(ASIA|DLC|EUR|GOTY|JPN|KOR|MULTI\d{1}|NTSCU?|PAL|RF|Region[._ -]?Free|USA|XBLA)[._ -](DLC[._ -]Complete|FRENCH|GERMAN|MULTI\d{1}|PROPER|PSN|READ[._ -]?NFO|UMD)?[._ -]?(GC|NDS|NGC|PS3|PSP|WII|XBOX(360)?)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["0"], $method = "gameCheck: Videogames 1", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\w[-\w.\',;& ]+(GC|NDS|NGC|PS3|WII|XBOX(360)?)[._ -](DUPLEX|iNSOMNi|OneUp|STRANGE|SWAG|SKY)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\w[-\w.\',;& ]+(GC|NDS|NGC|PS3|WII|XBOX(360)?)[._ -](DUPLEX|iNSOMNi|OneUp|STRANGE|SWAG|SKY)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["0"], $method = "gameCheck: Videogames 2", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\w[\w.\',;-].+-OUTLAWS/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\w[\w.\',;-].+-OUTLAWS/i', $release["textstring"], $result)) { $result = str_replace("OUTLAWS", "PC GAME OUTLAWS", $result['0']); $this->updateRelease($release, $result["0"], $method = "gameCheck: PC Games -OUTLAWS", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\w[\w.\',;-].+\-ALiAS/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\w[\w.\',;-].+\-ALiAS/i', $release["textstring"], $result)) { $newresult = str_replace("-ALiAS", " PC GAME ALiAS", $result['0']); $this->updateRelease($release, $newresult, $method = "gameCheck: PC Games -ALiAS", $echo, $type, $namestatus, $show); } @@ -782,9 +782,9 @@ class NameFixer public function appCheck($release, $echo, $type, $namestatus, $show) { $result = ''; - if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\w[-\w.\',;& ]+(\d{1,10}|Linux|UNIX)[._ -](RPM)?[._ -]?(X64)?[._ -]?(Incl)[._ -](Keygen)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { + if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\w[-\w.\',;& ]+(\d{1,10}|Linux|UNIX)[._ -](RPM)?[._ -]?(X64)?[._ -]?(Incl)[._ -](Keygen)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["0"], $method = "appCheck: Apps 1", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\w[-\w.\',;& ]+\d{1,8}[._ -](winall-freeware)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\w[-\w.\',;& ]+\d{1,8}[._ -](winall-freeware)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["0"], $method = "appCheck: Apps 2", $echo, $type, $namestatus, $show); } } @@ -797,9 +797,9 @@ class NameFixer public function nfoCheckTV($release, $echo, $type, $namestatus, $show) { $result = ''; - if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/:\s*.*[\\\\\/]([A-Z0-9].+?S\d+[.-_ ]?[ED]\d+.+?)\.\w{2,}\s+/i', $release["textstring"], $result)) { + if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/:\s*.*[\\\\\/]([A-Z0-9].+?S\d+[.-_ ]?[ED]\d+.+?)\.\w{2,}\s+/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["1"], $method = "nfoCheck: Generic TV 1", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/(?:(\:\s{1,}))(.+?S\d{1,3}[.-_ ]?[ED]\d{1,3}.+?)(\s{2,}|\r|\n)/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/(?:(\:\s{1,}))(.+?S\d{1,3}[.-_ ]?[ED]\d{1,3}.+?)(\s{2,}|\r|\n)/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["2"], $method = "nfoCheck: Generic TV 2", $echo, $type, $namestatus, $show); } } @@ -808,11 +808,11 @@ class NameFixer public function nfoCheckMov($release, $echo, $type, $namestatus, $show) { $result = ''; - if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/(?:(\:\s{1,}))(.+?(19|20)\d\d.+?(BDRip|bluray|DVD(R|Rip)?|XVid).+?)(\s{2,}|\r|\n)/i', $release["textstring"], $result)) { + if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/(?:(\:\s{1,}))(.+?(19|20)\d\d.+?(BDRip|bluray|DVD(R|Rip)?|XVID).+?)(\s{2,}|\r|\n)/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["2"], $method = "nfoCheck: Generic Movies 1", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/(?:(\s{2,}))(.+?[\.\-_ ](19|20)\d\d.+?(BDRip|bluray|DVD(R|Rip)?|XVid).+?)(\s{2,}|\r|\n)/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/(?:(\s{2,}))(.+?[\.\-_ ](19|20)\d\d.+?(BDRip|bluray|DVD(R|Rip)?|XVID).+?)(\s{2,}|\r|\n)/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["2"], $method = "nfoCheck: Generic Movies 2", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/(?:(\s{2,}))(.+?[\.\-_ ](NTSC|MULTi).+?(MULTi|DVDR)[\.\-_ ].+?)(\s{2,}|\r|\n)/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/(?:(\s{2,}))(.+?[\.\-_ ](NTSC|MULTi).+?(MULTi|DVDR)[\.\-_ ].+?)(\s{2,}|\r|\n)/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["2"], $method = "nfoCheck: Generic Movies 3", $echo, $type, $namestatus, $show); } } @@ -821,7 +821,7 @@ class NameFixer public function nfoCheckMus($release, $echo, $type, $namestatus, $show) { $result = ''; - if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/(?:\s{2,})(.+?-FM-\d{2}-\d{2})/i', $release["textstring"], $result)) { + if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/(?:\s{2,})(.+?-FM-\d{2}-\d{2})/i', $release["textstring"], $result)) { $newname = str_replace('-FM-', '-FM-Radio-MP3-', $result["1"]); $this->updateRelease($release, $newname, $method = "nfoCheck: Music FM RADIO", $echo, $type, $namestatus, $show); } @@ -831,9 +831,9 @@ class NameFixer public function nfoCheckTY($release, $echo, $type, $namestatus, $show) { $result = ''; - if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/(\w[-\w`~!@#$%^&*()_+={}|"<>?\[\]\\;\',.\/ ]+\s?\((19|20)\d\d\))/i', $release["textstring"], $result) && !preg_match('/\.pdf|Audio ?Book/i', $release["textstring"])) { + if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/(\w[-\w`~!@#$%^&*()_+={}|"<>?\[\]\\;\',.\/ ]+\s?\((19|20)\d\d\))/i', $release["textstring"], $result) && !preg_match('/\.pdf|Audio ?Book/i', $release["textstring"])) { $releasename = $result[0]; - if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/(idiomas|lang|language|langue|sprache).*?\b(Brazilian|Chinese|Croatian|Danish|DE|Deutsch|Dutch|Estonian|ES|English|Englisch|Finnish|Flemish|Francais|French|FR|German|Greek|Hebrew|Icelandic|Italian|Japenese|Japan|Japanese|Korean|Latin|Nordic|Norwegian|Polish|Portuguese|Russian|Serbian|Slovenian|Swedish|Spanisch|Spanish|Thai|Turkish)\b/i', $release["textstring"], $result)) { + if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/(idiomas|lang|language|langue|sprache).*?\b(Brazilian|Chinese|Croatian|Danish|DE|Deutsch|Dutch|Estonian|ES|English|Englisch|Finnish|Flemish|Francais|French|FR|German|Greek|Hebrew|Icelandic|Italian|Japenese|Japan|Japanese|Korean|Latin|Nordic|Norwegian|Polish|Portuguese|Russian|Serbian|Slovenian|Swedish|Spanisch|Spanish|Thai|Turkish)\b/i', $release["textstring"], $result)) { if ($result[2] == 'DE') { $result[2] = 'DUTCH'; } else if ($result[2] == 'Englisch') { @@ -845,7 +845,7 @@ class NameFixer } $releasename = $releasename . "." . $result[2]; } - if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/(frame size|res|resolution|video|video res).*?(272|336|480|494|528|608|640|\(640|688|704|720x480|816|820|1080|1 080|1280 @|1280|1920|1 920|1920x1080)/i', $release["textstring"], $result)) { + if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/(frame size|res|resolution|video|video res).*?(272|336|480|494|528|608|640|\(640|688|704|720x480|816|820|1080|1 080|1280 @|1280|1920|1 920|1920x1080)/i', $release["textstring"], $result)) { if ($result[2] == '272') { $result[2] = '272p'; } else if ($result[2] == '336') { @@ -889,7 +889,7 @@ class NameFixer } $releasename = $releasename . "." . $result[2]; } - if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/(largeur|width).*?(640|\(640|688|704|720|1280 @|1280|1920|1 920)/i', $release["textstring"], $result)) { + if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/(largeur|width).*?(640|\(640|688|704|720|1280 @|1280|1920|1 920)/i', $release["textstring"], $result)) { if ($result[2] == '640') { $result[2] = '480p'; } else if ($result[2] == '\(640') { @@ -911,7 +911,7 @@ class NameFixer } $releasename = $releasename . "." . $result[2]; } - if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/source.*?\b(BD(-?(25|50|RIP))?|Blu-?Ray ?(3D)?|BRRIP|CAM(RIP)?|DBrip|DTV|DVD\-?(5|9|(R(IP)?|scr(eener)?))?|[HPS]D?(RIP|TV(RIP)?)?|NTSC|PAL|R5|Ripped |S?VCD|scr(eener)?|SAT(RIP)?|TS|VHS(RIP)?|VOD|WEB-DL)\b/i', $release["textstring"], $result)) { + if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/source.*?\b(BD(-?(25|50|RIP))?|Blu-?Ray ?(3D)?|BRRIP|CAM(RIP)?|DBrip|DTV|DVD\-?(5|9|(R(IP)?|scr(eener)?))?|[HPS]D?(RIP|TV(RIP)?)?|NTSC|PAL|R5|Ripped |S?VCD|scr(eener)?|SAT(RIP)?|TS|VHS(RIP)?|VOD|WEB-DL)\b/i', $release["textstring"], $result)) { if ($result[1] == 'BD') { $result[1] = 'Bluray.x264'; } else if ($result[1] == 'CAMRIP') { @@ -933,7 +933,7 @@ class NameFixer } $releasename = $releasename . "." . $result[1]; } - if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/(codec|codec name|codec code|format|MPEG-4 Visual|original format|res|resolution|video|video codec|video format|video res|tv system|type|writing library).*?\b(AVC|AVI|DBrip|DIVX|\(Divx|DVD|[HX][._ -]?264|NTSC|PAL|WMV|XVid)\b/i', $release["textstring"], $result)) { + if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/(codec|codec name|codec code|format|MPEG-4 Visual|original format|res|resolution|video|video codec|video format|video res|tv system|type|writing library).*?\b(AVC|AVI|DBrip|DIVX|\(Divx|DVD|[HX][._ -]?264|NTSC|PAL|WMV|XVID)\b/i', $release["textstring"], $result)) { if ($result[2] == 'AVI') { $result[2] = 'DVDRIP'; } else if ($result[2] == 'DBrip') { @@ -953,7 +953,7 @@ class NameFixer } $releasename = $releasename . "." . $result[2]; } - if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/(audio|audio format|codec|codec name|format).*?\b(0x0055 MPEG-1 Layer 3|AAC( LC)?|AC-?3|\(AC3|DD5(.1)?|(A_)?DTS-?(HD)?|Dolby(\s?TrueHD)?|TrueHD|FLAC|MP3)\b/i', $release["textstring"], $result)) { + if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/(audio|audio format|codec|codec name|format).*?\b(0x0055 MPEG-1 Layer 3|AAC( LC)?|AC-?3|\(AC3|DD5(.1)?|(A_)?DTS-?(HD)?|Dolby(\s?TrueHD)?|TrueHD|FLAC|MP3)\b/i', $release["textstring"], $result)) { if ($result[2] == '0x0055 MPEG-1 Layer 3') { $result[2] = 'MP3'; } else if ($result[2] == 'AC-3') { @@ -979,12 +979,12 @@ class NameFixer // Games. public function nfoCheckG($release, $echo, $type, $namestatus, $show) { - if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/ALiAS|BAT-TEAM|\FAiRLiGHT|Game Type|Glamoury|HI2U|iTWINS|JAGUAR|LARGEISO|MAZE|MEDIUMISO|nERv|PROPHET|PROFiT|PROCYON|RELOADED|REVOLVER|ROGUE|ViTALiTY/i', $release["textstring"])) { + if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/ALiAS|BAT-TEAM|\FAiRLiGHT|Game Type|Glamoury|HI2U|iTWINS|JAGUAR|LARGEISO|MAZE|MEDIUMISO|nERv|PROPHET|PROFiT|PROCYON|RELOADED|REVOLVER|ROGUE|ViTALiTY/i', $release["textstring"])) { $result = ''; - if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\w[\w.+&*\/\()\',;: -]+\(c\)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { + if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\w[\w.+&*\/\()\',;: -]+\(c\)[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { $releasename = str_replace(array("(c)", "(C)"), "(GAMES) (c)", $result['0']); $this->updateRelease($release, $releasename, $method = "nfoCheck: PC Games (c)", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\w[\w.+&*\/()\',;: -]+\*ISO\*/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\w[\w.+&*\/()\',;: -]+\*ISO\*/i', $release["textstring"], $result)) { $releasename = str_replace("*ISO*", "*ISO* (PC GAMES)", $result['0']); $this->updateRelease($release, $releasename, $method = "nfoCheck: PC Games *ISO*", $echo, $type, $namestatus, $show); } @@ -994,18 +994,18 @@ class NameFixer // Misc. public function nfoCheckMisc($release, $echo, $type, $namestatus, $show) { - if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/Supplier.+?IGUANA/i', $release["textstring"])) { + if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/Supplier.+?IGUANA/i', $release["textstring"])) { $releasename = ''; $result = ''; - if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\w[-\w`~!@#$%^&*()+={}|:"<>?\[\]\\;\',.\/ ]+\s\((19|20)\d\d\)/i', $release["textstring"], $result)) { + if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\w[-\w`~!@#$%^&*()+={}|:"<>?\[\]\\;\',.\/ ]+\s\((19|20)\d\d\)/i', $release["textstring"], $result)) { $releasename = $result[0]; - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\s\[\*\] (English|Dutch|French|German|Spanish)\b/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\s\[\*\] (English|Dutch|French|German|Spanish)\b/i', $release["textstring"], $result)) { $releasename = $releasename . "." . $result[1]; - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\s\[\*\] (DTS 6[._ -]1|DS 5[._ -]1|DS 2[._ -]0|DS 2[._ -]0 MONO)\b/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\s\[\*\] (DTS 6[._ -]1|DS 5[._ -]1|DS 2[._ -]0|DS 2[._ -]0 MONO)\b/i', $release["textstring"], $result)) { $releasename = $releasename . "." . $result[2]; - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/Format.+(DVD(5|9|R)?|[HX][._ -]?264)\b/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/Format.+(DVD(5|9|R)?|[HX][._ -]?264)\b/i', $release["textstring"], $result)) { $releasename = $releasename . "." . $result[1]; - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\[(640x.+|1280x.+|1920x.+)\] Resolution\b/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\[(640x.+|1280x.+|1920x.+)\] Resolution\b/i', $release["textstring"], $result)) { if ($result[1] == '640x.+') { $result[1] = '480p'; } else if ($result[1] == '1280x.+') { @@ -1027,45 +1027,45 @@ class NameFixer public function fileCheck($release, $echo, $type, $namestatus, $show) { $result = ''; - if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/^(.+?(x264|XviD)\-TVP)\\\\/i', $release["textstring"], $result)) { + if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/^(.+?(x264|XviD)\-TVP)\\\\/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["1"], $method = "fileCheck: TVP", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/^(\\\\|\/)?(.+(\\\\|\/))*(.+?S\d{1,3}[.-_ ]?[ED]\d{1,3}.+)\.(.+)$/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/^(\\\\|\/)?(.+(\\\\|\/))*(.+?S\d{1,3}[.-_ ]?[ED]\d{1,3}.+)\.(.+)$/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["4"], $method = "fileCheck: Generic TV", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/^(\\\\|\/)?(.+(\\\\|\/))*(.+?([\.\-_ ]\d{4}[\.\-_ ].+?(BDRip|bluray|DVDRip|XVid)).+)\.(.+)$/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/^(\\\\|\/)?(.+(\\\\|\/))*(.+?([\.\-_ ]\d{4}[\.\-_ ].+?(BDRip|bluray|DVDRip|XVID)).+)\.(.+)$/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["4"], $method = "fileCheck: Generic movie 1", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/^([a-z0-9\.\-_]+(19|20)\d\d[a-z0-9\.\-_]+[\.\-_ ](720p|1080p|BDRip|bluray|DVDRip|x264|XviD)[a-z0-9\.\-_]+)\.[a-z]{2,}$/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/^([a-z0-9\.\-_]+(19|20)\d\d[a-z0-9\.\-_]+[\.\-_ ](720p|1080p|BDRip|bluray|DVDRip|x264|XviD)[a-z0-9\.\-_]+)\.[a-z]{2,}$/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["1"], $method = "fileCheck: Generic movie 2", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/(.+?([\.\-_ ](CD|FM)|[\.\-_ ]\dCD|CDR|FLAC|SAT|WEB).+?(19|20)\d\d.+?)\\\\.+/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/(.+?([\.\-_ ](CD|FM)|[\.\-_ ]\dCD|CDR|FLAC|SAT|WEB).+?(19|20)\d\d.+?)\\\\.+/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["1"], $method = "fileCheck: Generic music", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/^(.+?(19|20)\d\d\-([a-z0-9]{3}|[a-z]{2,}|C4))\\\\/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/^(.+?(19|20)\d\d\-([a-z0-9]{3}|[a-z]{2,}|C4))\\\\/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["1"], $method = "fileCheck: music groups", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/.+\\\\(.+\((19|20)\d\d\)\.avi)/i', $release["textstring"], $result)) { - $newname = str_replace('.avi', ' DVDRip XVid NoGroup', $result["1"]); + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/.+\\\\(.+\((19|20)\d\d\)\.avi)/i', $release["textstring"], $result)) { + $newname = str_replace('.avi', ' DVDRip XVID NoGroup', $result["1"]); $this->updateRelease($release, $newname, $method = "fileCheck: Movie (year) avi", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/.+\\\\(.+\((19|20)\d\d\)\.iso)/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/.+\\\\(.+\((19|20)\d\d\)\.iso)/i', $release["textstring"], $result)) { $newname = str_replace('.iso', ' DVD NoGroup', $result["1"]); $this->updateRelease($release, $newname, $method = "fileCheck: Movie (year) iso", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/^(.+?IMAGESET.+?)\\\\.+/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/^(.+?IMAGESET.+?)\\\\.+/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["1"], $method = "fileCheck: XXX Imagesets", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\w[-\w.\',;& ]+1080i[._ -]DD5[._ -]1[._ -]MPEG2-R&C(?=\.ts)/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\w[-\w.\',;& ]+1080i[._ -]DD5[._ -]1[._ -]MPEG2-R&C(?=\.ts)/i', $release["textstring"], $result)) { $result = str_replace("MPEG2", "MPEG2.HDTV", $result["0"]); $this->updateRelease($release, $result, $method = "fileCheck: R&C", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\w[-\w.\',;& ]+((s\d{1,2}[._ -]?[bde]\d{1,2})|\d{1,2}x\d{2}|ep[._ -]?\d{2})[._ -](480|720|1080)[ip][._ -](BD(-?(25|50|RIP))?|Blu-?Ray ?(3D)?|BRRIP|CAM(RIP)?|DBrip|DTV|DVD\-?(5|9|(R(IP)?|scr(eener)?))?|[HPS]D?(RIP|TV(RIP)?)?|NTSC|PAL|R5|Ripped |S?VCD|scr(eener)?|SAT(RIP)?|TS|VHS(RIP)?|VOD|WEB-DL)[._ -]nSD[._ -](DivX|[HX][._ -]?264|MPEG2|XviD(HD)?|WMV)[._ -]NhaNC3[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\w[-\w.\',;& ]+((s\d{1,2}[._ -]?[bde]\d{1,2})|\d{1,2}x\d{2}|ep[._ -]?\d{2})[._ -](480|720|1080)[ip][._ -](BD(-?(25|50|RIP))?|Blu-?Ray ?(3D)?|BRRIP|CAM(RIP)?|DBrip|DTV|DVD\-?(5|9|(R(IP)?|scr(eener)?))?|[HPS]D?(RIP|TV(RIP)?)?|NTSC|PAL|R5|Ripped |S?VCD|scr(eener)?|SAT(RIP)?|TS|VHS(RIP)?|VOD|WEB-DL)[._ -]nSD[._ -](DivX|[HX][._ -]?264|MPEG2|XviD(HD)?|WMV)[._ -]NhaNC3[-\w.\',;& ]+\w/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["0"], $method = "fileCheck: NhaNc3", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\wtvp-[\w.\-\',;]+((s\d{1,2}[._ -]?[bde]\d{1,2})|\d{1,2}x\d{2}|ep[._ -]?\d{2})[._ -](720p|1080p|xvid)(?=\.(avi|mkv))/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\wtvp-[\w.\-\',;]+((s\d{1,2}[._ -]?[bde]\d{1,2})|\d{1,2}x\d{2}|ep[._ -]?\d{2})[._ -](720p|1080p|xvid)(?=\.(avi|mkv))/i', $release["textstring"], $result)) { $result = str_replace("720p", "720p.HDTV.X264", $result['0']); $result = str_replace("1080p", "1080p.Bluray.X264", $result['0']); - $result = str_replace("xvid", "XVid.DVDrip", $result['0']); + $result = str_replace("xvid", "XVID.DVDrip", $result['0']); $this->updateRelease($release, $result, $method = "fileCheck: tvp", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\w[-\w.\',;& ]+\d{3,4}\.hdtv-lol\.(avi|mp4|mkv|ts|nfo|nzb)/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\w[-\w.\',;& ]+\d{3,4}\.hdtv-lol\.(avi|mp4|mkv|ts|nfo|nzb)/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["0"], $method = "fileCheck: Title.211.hdtv-lol.extension", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\w[-\w.\',;& ]+-S\d{1,2}[EX]\d{1,2}-XVid-DL.avi/i', $release["textstring"], $result)) { - $this->updateRelease($release, $result["0"], $method = "fileCheck: Title-SxxExx-XVid-DL.avi", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\S.*[\w.\-\',;]+\s\-\ss\d{2}[ex]\d{2}\s\-\s[\w.\-\',;].+\./i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\w[-\w.\',;& ]+-S\d{1,2}[EX]\d{1,2}-XVID-DL.avi/i', $release["textstring"], $result)) { + $this->updateRelease($release, $result["0"], $method = "fileCheck: Title-SxxExx-XVID-DL.avi", $echo, $type, $namestatus, $show); + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\S.*[\w.\-\',;]+\s\-\ss\d{2}[ex]\d{2}\s\-\s[\w.\-\',;].+\./i', $release["textstring"], $result)) { $this->updateRelease($release, $result["0"], $method = "fileCheck: Title - SxxExx - Eptitle", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\w.+?\)\.nds/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\w.+?\)\.nds/i', $release["textstring"], $result)) { $this->updateRelease($release, $result["0"], $method = "fileCheck: ).nds Nintendo DS", $echo, $type, $namestatus, $show); - } else if ($this->done === false && $this->relid !== $release["releaseid"] && preg_match('/\w.+?\.(pdf|htm(l)?|epub|mobi|azw|opf|fb2|prc|djvu|cb[rz])/i', $release["textstring"], $result)) { + } else if ($this->done === false && $this->relid !== $release["releaseID"] && preg_match('/\w.+?\.(pdf|htm(l)?|epub|mobi|azw|opf|fb2|prc|djvu|cb[rz])/i', $release["textstring"], $result)) { $result = str_replace("." . $result["1"], " (" . $result["1"] . ")", $result['0']); $this->updateRelease($release, $result, $method = "fileCheck: EBook", $echo, $type, $namestatus, $show); } diff --git a/python/postprocess_threaded.py b/python/postprocess_threaded.py index c5e212f2e..8093b28a1 100644 --- a/python/postprocess_threaded.py +++ b/python/postprocess_threaded.py @@ -19,7 +19,7 @@ conf = info.readConfig() cur = info.connect() if len(sys.argv) == 1: - print(bcolors.ERROR + "\nWrong set of arguments.\nThe first argument [additional, nfo, movie, clean] determines the postprocessing to do.\nThe optional second argument for [additional, nfo] [groupid, categoryid] allows to process only that group or category.\nThe optional second argument for [movies, tv] [clean] allows processing only properly renamed releases.\n\npython postprocess_threaded.py [additional, nfo] (optional [groupid, categoryid])\npython postprocess_threaded.py [movie, tv] (optional [clean])\n" + bcolors.ENDC) + print(bcolors.ERROR + "\nWrong set of arguments.\nThe first argument [additional, nfo, movie, clean] determines the postprocessing to do.\nThe optional second argument for [additional, nfo] [groupID, categoryID] allows to process only that group or category.\nThe optional second argument for [movies, tv] [clean] allows processing only properly renamed releases.\n\npython postprocess_threaded.py [additional, nfo] (optional [groupID, categoryID])\npython postprocess_threaded.py [movie, tv] (optional [clean])\n" + bcolors.ENDC) sys.exit() if len(sys.argv) == 3 and sys.argv[2] == "clean": print(bcolors.HEADER + "\nPostProcess {} Clean Threaded Started at {}".format(sys.argv[1],datetime.datetime.now().strftime("%H:%M:%S")) + bcolors.ENDC) @@ -33,40 +33,40 @@ if sys.argv[1] == "additional": elif sys.argv[1] == "nfo": print(bcolors.HEADER + "* = hidden NFO, + = NFO, - = no NFO, f = download failed." + bcolors.ENDC) -# You can limit postprocessing for additional and nfo by groupid or categoryid +# You can limit postprocessing for additional and nfo by groupID or categoryID if len(sys.argv) == 3 and sys.argv[2].isdigit() and len(sys.argv[2]) < 4: - groupid = 'AND groupid = '+sys.argv[2] - print(bcolors.HEADER + "Using groupid "+sys.argv[2] + bcolors.ENDC) + groupID = 'AND groupID = '+sys.argv[2] + print(bcolors.HEADER + "Using groupID "+sys.argv[2] + bcolors.ENDC) elif len(sys.argv) == 3 and sys.argv[2].isdigit() and len(sys.argv[2]) == 4: if sys.argv[2] == '1000': - groupid = 'AND categoryid BETWEEN 1000 AND 1999' + groupID = 'AND categoryID BETWEEN 1000 AND 1999' print(bcolors.HEADER + "Using categoryids 1000-1999" + bcolors.ENDC) elif sys.argv[2] == '2000': - groupid = 'AND categoryid BETWEEN 2000 AND 2999' + groupID = 'AND categoryID BETWEEN 2000 AND 2999' print(bcolors.HEADER + "Using categoryids 2000-2999" + bcolors.ENDC) elif sys.argv[2] == '3000': - groupid = 'AND categoryid BETWEEN 3000 AND 3999' + groupID = 'AND categoryID BETWEEN 3000 AND 3999' print(bcolors.HEADER + "Using categoryids 3000-3999" + bcolors.ENDC) elif sys.argv[2] == '4000': - groupid = 'AND categoryid BETWEEN 4000 AND 4999' + groupID = 'AND categoryID BETWEEN 4000 AND 4999' print(bcolors.HEADER + "Using categoryids 4000-4999" + bcolors.ENDC) elif sys.argv[2] == '5000': - groupid = 'AND categoryid BETWEEN 5000 AND 5999' + groupID = 'AND categoryID BETWEEN 5000 AND 5999' print(bcolors.HEADER + "Using categoryids 5000-5999" + bcolors.ENDC) elif sys.argv[2] == '6000': - groupid = 'AND categoryid BETWEEN 6000 AND 6999' + groupID = 'AND categoryID BETWEEN 6000 AND 6999' print(bcolors.HEADER + "Using categoryids 6000-6999" + bcolors.ENDC) elif sys.argv[2] == '7000': - groupid = 'AND categoryid BETWEEN 7000 AND 7999' + groupID = 'AND categoryID BETWEEN 7000 AND 7999' print(bcolors.HEADER + "Using categoryids 7000-7999" + bcolors.ENDC) elif sys.argv[2] == '8000': - groupid = 'AND categoryid BETWEEN 8000 AND 8999' + groupID = 'AND categoryID BETWEEN 8000 AND 8999' print(bcolors.HEADER + "Using categoryids 8000-8999" + bcolors.ENDC) else: - groupid = 'AND categoryid = '+sys.argv[2] - print(bcolors.HEADER + "Using categoryid "+sys.argv[2] + bcolors.ENDC) + groupID = 'AND categoryID = '+sys.argv[2] + print(bcolors.HEADER + "Using categoryID "+sys.argv[2] + bcolors.ENDC) else: - groupid = '' + groupID = '' #you can sort tv releases by searchname if len(sys.argv) == 3 and (sys.argv[2] == "asc" or sys.argv[2] == "desc"): @@ -82,7 +82,7 @@ start_time = time.time() pathname = os.path.abspath(os.path.dirname(sys.argv[0])) if len(sys.argv) > 1 and sys.argv[1] == "additional": - cur[0].execute("SELECT (SELECT value FROM tmux WHERE setting = 'postthreads') AS a, (SELECT value FROM tmux WHERE setting = 'maxaddprocessed') AS b, (SELECT value FROM tmux WHERE setting = 'maxnfoprocessed') AS c, (SELECT value FROM tmux WHERE setting = 'maximdbprocessed') AS d, (SELECT value FROM tmux WHERE setting = 'maxrageprocessed') AS e, (SELECT value FROM tmux WHERE setting = 'maxsizetopostprocess') AS f, (SELECT value FROM site WHERE setting = 'tmpunrarpath') AS g, (SELECT value FROM tmux WHERE setting = 'post') AS h, (SELECT value FROM tmux WHERE setting = 'post_non') AS i, (SELECT count(*) FROM releases WHERE haspreview = -1 and passwordstatus = -1 "+groupid+") as j, (SELECT count(*) FROM releases WHERE haspreview = -1 and passwordstatus = -2 "+groupid+") as k, (SELECT count(*) FROM releases WHERE haspreview = -1 and passwordstatus = -3 "+groupid+") as l, (SELECT count(*) FROM releases WHERE haspreview = -1 and passwordstatus = -4 "+groupid+") as m, (SELECT count(*) FROM releases WHERE haspreview = -1 and passwordstatus = -5 "+groupid+") as n, (SELECT count(*) FROM releases WHERE haspreview = -1 and passwordstatus = -6 "+groupid+") as o") + cur[0].execute("SELECT (SELECT value FROM tmux WHERE setting = 'postthreads') AS a, (SELECT value FROM tmux WHERE setting = 'maxaddprocessed') AS b, (SELECT value FROM tmux WHERE setting = 'maxnfoprocessed') AS c, (SELECT value FROM tmux WHERE setting = 'maximdbprocessed') AS d, (SELECT value FROM tmux WHERE setting = 'maxrageprocessed') AS e, (SELECT value FROM tmux WHERE setting = 'maxsizetopostprocess') AS f, (SELECT value FROM site WHERE setting = 'tmpunrarpath') AS g, (SELECT value FROM tmux WHERE setting = 'post') AS h, (SELECT value FROM tmux WHERE setting = 'post_non') AS i, (SELECT count(*) FROM releases WHERE haspreview = -1 and passwordstatus = -1 "+groupID+") as j, (SELECT count(*) FROM releases WHERE haspreview = -1 and passwordstatus = -2 "+groupID+") as k, (SELECT count(*) FROM releases WHERE haspreview = -1 and passwordstatus = -3 "+groupID+") as l, (SELECT count(*) FROM releases WHERE haspreview = -1 and passwordstatus = -4 "+groupID+") as m, (SELECT count(*) FROM releases WHERE haspreview = -1 and passwordstatus = -5 "+groupID+") as n, (SELECT count(*) FROM releases WHERE haspreview = -1 and passwordstatus = -6 "+groupID+") as o") dbgrab = cur[0].fetchall() ps1 = format(int(dbgrab[0][9])) ps2 = format(int(dbgrab[0][10])) @@ -91,7 +91,7 @@ if len(sys.argv) > 1 and sys.argv[1] == "additional": ps5 = format(int(dbgrab[0][13])) ps6 = format(int(dbgrab[0][14])) elif len(sys.argv) > 1 and sys.argv[1] == "nfo": - cur[0].execute("SELECT (SELECT value FROM tmux WHERE setting = 'postthreads') AS a, (SELECT value FROM tmux WHERE setting = 'maxaddprocessed') AS b, (SELECT value FROM tmux WHERE setting = 'maxnfoprocessed') AS c, (SELECT value FROM tmux WHERE setting = 'maximdbprocessed') AS d, (SELECT value FROM tmux WHERE setting = 'maxrageprocessed') AS e, (SELECT value FROM tmux WHERE setting = 'maxsizetopostprocess') AS f, (SELECT value FROM site WHERE setting = 'tmpunrarpath') AS g, (SELECT value FROM tmux WHERE setting = 'post') AS h, (SELECT value FROM tmux WHERE setting = 'post_non') AS i, (SELECT count(*) FROM releases WHERE nfostatus = -1 AND releasenfoid = 0 "+groupid+") as j, (SELECT count(*) FROM releases WHERE nfostatus = -2 AND releasenfoid = 0 "+groupid+") as k, (SELECT count(*) FROM releases WHERE nfostatus = -3 AND releasenfoid = 0 "+groupid+") as l, (SELECT count(*) FROM releases WHERE nfostatus = -4 AND releasenfoid = 0 "+groupid+") as m, (SELECT count(*) FROM releases WHERE nfostatus = -5 AND releasenfoid = 0 "+groupid+") as n, (SELECT count(*) FROM releases WHERE nfostatus = -6 AND releasenfoid = 0 "+groupid+") as o") + cur[0].execute("SELECT (SELECT value FROM tmux WHERE setting = 'postthreads') AS a, (SELECT value FROM tmux WHERE setting = 'maxaddprocessed') AS b, (SELECT value FROM tmux WHERE setting = 'maxnfoprocessed') AS c, (SELECT value FROM tmux WHERE setting = 'maximdbprocessed') AS d, (SELECT value FROM tmux WHERE setting = 'maxrageprocessed') AS e, (SELECT value FROM tmux WHERE setting = 'maxsizetopostprocess') AS f, (SELECT value FROM site WHERE setting = 'tmpunrarpath') AS g, (SELECT value FROM tmux WHERE setting = 'post') AS h, (SELECT value FROM tmux WHERE setting = 'post_non') AS i, (SELECT count(*) FROM releases WHERE nfostatus = -1 AND releasenfoID = 0 "+groupID+") as j, (SELECT count(*) FROM releases WHERE nfostatus = -2 AND releasenfoID = 0 "+groupID+") as k, (SELECT count(*) FROM releases WHERE nfostatus = -3 AND releasenfoID = 0 "+groupID+") as l, (SELECT count(*) FROM releases WHERE nfostatus = -4 AND releasenfoID = 0 "+groupID+") as m, (SELECT count(*) FROM releases WHERE nfostatus = -5 AND releasenfoID = 0 "+groupID+") as n, (SELECT count(*) FROM releases WHERE nfostatus = -6 AND releasenfoID = 0 "+groupID+") as o") dbgrab = cur[0].fetchall() ps1 = format(int(dbgrab[0][9])) ps2 = format(int(dbgrab[0][10])) @@ -132,76 +132,76 @@ process_additional = run_threads * ppperrun process_nfo = run_threads * nfoperrun if sys.argv[1] == "additional": - run = "SELECT r.id, r.guid, r.name, c.disablepreview, r.size, r.groupid, r.nfostatus, r.releasenfoid, r.categoryid, r.searchname from releases r LEFT JOIN category c ON c.id = r.categoryid WHERE nzbstatus = 1 "+maxsize+" AND r.passwordstatus = -1 AND r.haspreview = -1 AND c.disablepreview = 0 "+groupid+" ORDER BY postdate DESC LIMIT %s" + run = "SELECT r.ID, r.guid, r.name, c.disablepreview, r.size, r.groupID, r.nfostatus, r.releasenfoID, r.categoryID, r.searchname from releases r LEFT JOIN category c ON c.ID = r.categoryID WHERE nzbstatus = 1 "+maxsize+" AND r.passwordstatus = -1 AND r.haspreview = -1 AND c.disablepreview = 0 "+groupID+" ORDER BY postdate DESC LIMIT %s" cur[0].execute(run, process_additional) datas = cur[0].fetchall() maxtries = -1 if len(datas) < process_additional: - run = "SELECT r.id, r.guid, r.name, c.disablepreview, r.size, r.groupid, r.nfostatus, r.releasenfoid, r.categoryid, r.searchname from releases r LEFT JOIN category c ON c.id = r.categoryid WHERE nzbstatus = 1 "+maxsize+" AND r.passwordstatus = -2 AND r.haspreview = -1 AND c.disablepreview = 0 "+groupid+" ORDER BY postdate DESC LIMIT %s" + run = "SELECT r.ID, r.guid, r.name, c.disablepreview, r.size, r.groupID, r.nfostatus, r.releasenfoID, r.categoryID, r.searchname from releases r LEFT JOIN category c ON c.ID = r.categoryID WHERE nzbstatus = 1 "+maxsize+" AND r.passwordstatus = -2 AND r.haspreview = -1 AND c.disablepreview = 0 "+groupID+" ORDER BY postdate DESC LIMIT %s" cur[0].execute(run, (process_additional - len(datas))) datas += cur[0].fetchall() maxtries = -2 if len(datas) < process_additional: - run = "SELECT r.id, r.guid, r.name, c.disablepreview, r.size, r.groupid, r.nfostatus, r.releasenfoid, r.categoryid, r.searchname from releases r LEFT JOIN category c ON c.id = r.categoryid WHERE nzbstatus = 1 "+maxsize+" AND r.passwordstatus = -3 AND r.haspreview = -1 AND c.disablepreview = 0 "+groupid+" ORDER BY postdate DESC LIMIT %s" + run = "SELECT r.ID, r.guid, r.name, c.disablepreview, r.size, r.groupID, r.nfostatus, r.releasenfoID, r.categoryID, r.searchname from releases r LEFT JOIN category c ON c.ID = r.categoryID WHERE nzbstatus = 1 "+maxsize+" AND r.passwordstatus = -3 AND r.haspreview = -1 AND c.disablepreview = 0 "+groupID+" ORDER BY postdate DESC LIMIT %s" cur[0].execute(run, (process_additional - len(datas))) datas += cur[0].fetchall() maxtries = -3 if len(datas) < process_additional: - run = "SELECT r.id, r.guid, r.name, c.disablepreview, r.size, r.groupid, r.nfostatus, r.releasenfoid, r.categoryid, r.searchname from releases r LEFT JOIN category c ON c.id = r.categoryid WHERE nzbstatus = 1 "+maxsize+" AND r.passwordstatus = -4 AND r.haspreview = -1 AND c.disablepreview = 0 "+groupid+" ORDER BY postdate DESC LIMIT %s" + run = "SELECT r.ID, r.guid, r.name, c.disablepreview, r.size, r.groupID, r.nfostatus, r.releasenfoID, r.categoryID, r.searchname from releases r LEFT JOIN category c ON c.ID = r.categoryID WHERE nzbstatus = 1 "+maxsize+" AND r.passwordstatus = -4 AND r.haspreview = -1 AND c.disablepreview = 0 "+groupID+" ORDER BY postdate DESC LIMIT %s" cur[0].execute(run, (process_additional - len(datas))) datas += cur[0].fetchall() maxtries = -4 if len(datas) < process_additional: - run = "SELECT r.id, r.guid, r.name, c.disablepreview, r.size, r.groupid, r.nfostatus, r.releasenfoid, r.categoryid, r.searchname from releases r LEFT JOIN category c ON c.id = r.categoryid WHERE nzbstatus = 1 "+maxsize+" AND r.passwordstatus = -5 AND r.haspreview = -1 AND c.disablepreview = 0 "+groupid+" ORDER BY postdate DESC LIMIT %s" + run = "SELECT r.ID, r.guid, r.name, c.disablepreview, r.size, r.groupID, r.nfostatus, r.releasenfoID, r.categoryID, r.searchname from releases r LEFT JOIN category c ON c.ID = r.categoryID WHERE nzbstatus = 1 "+maxsize+" AND r.passwordstatus = -5 AND r.haspreview = -1 AND c.disablepreview = 0 "+groupID+" ORDER BY postdate DESC LIMIT %s" cur[0].execute(run, (process_additional - len(datas))) datas += cur[0].fetchall() maxtries = -5 if len(datas) < process_additional: - run = "SELECT r.id, r.guid, r.name, c.disablepreview, r.size, r.groupid, r.nfostatus, r.releasenfoid, r.categoryid, r.searchname from releases r LEFT JOIN category c ON c.id = r.categoryid WHERE nzbstatus = 1 "+maxsize+" AND r.passwordstatus = -6 AND r.haspreview = -1 AND c.disablepreview = 0 "+groupid+" ORDER BY postdate DESC LIMIT %s" + run = "SELECT r.ID, r.guid, r.name, c.disablepreview, r.size, r.groupID, r.nfostatus, r.releasenfoID, r.categoryID, r.searchname from releases r LEFT JOIN category c ON c.ID = r.categoryID WHERE nzbstatus = 1 "+maxsize+" AND r.passwordstatus = -6 AND r.haspreview = -1 AND c.disablepreview = 0 "+groupID+" ORDER BY postdate DESC LIMIT %s" cur[0].execute(run, (process_additional - len(datas))) datas += cur[0].fetchall() maxtries = -6 elif sys.argv[1] == "nfo": - cur[0].execute("SELECT id, guid, groupid, name from releases WHERE nzbstatus = 1 AND releasenfoid = 0 AND nfostatus = -1 "+groupid+" ORDER BY postdate DESC LIMIT "+str(process_nfo)) + cur[0].execute("SELECT ID, guid, groupID, name from releases WHERE nzbstatus = 1 AND releasenfoID = 0 AND nfostatus = -1 "+groupID+" ORDER BY postdate DESC LIMIT "+str(process_nfo)) datas = cur[0].fetchall() maxtries = -1 if len(datas) < process_nfo: - cur[0].execute("SELECT id, guid, groupid, name from releases WHERE nzbstatus = 1 AND releasenfoid = 0 AND nfostatus = -2 "+groupid+" ORDER BY postdate DESC LIMIT "+str(process_nfo - len(datas))) + cur[0].execute("SELECT ID, guid, groupID, name from releases WHERE nzbstatus = 1 AND releasenfoID = 0 AND nfostatus = -2 "+groupID+" ORDER BY postdate DESC LIMIT "+str(process_nfo - len(datas))) datas += cur[0].fetchall() maxtries = -2 if len(datas) < process_nfo: - cur[0].execute("SELECT id, guid, groupid, name from releases WHERE nzbstatus = 1 AND releasenfoid = 0 AND nfostatus = -3 "+groupid+" ORDER BY postdate DESC LIMIT "+str(process_nfo - len(datas))) + cur[0].execute("SELECT ID, guid, groupID, name from releases WHERE nzbstatus = 1 AND releasenfoID = 0 AND nfostatus = -3 "+groupID+" ORDER BY postdate DESC LIMIT "+str(process_nfo - len(datas))) datas += cur[0].fetchall() maxtries = -3 if len(datas) < process_nfo: - cur[0].execute("SELECT id, guid, groupid, name from releases WHERE nzbstatus = 1 AND releasenfoid = 0 AND nfostatus = -4 "+groupid+" ORDER BY postdate DESC LIMIT "+str(process_nfo - len(datas))) + cur[0].execute("SELECT ID, guid, groupID, name from releases WHERE nzbstatus = 1 AND releasenfoID = 0 AND nfostatus = -4 "+groupID+" ORDER BY postdate DESC LIMIT "+str(process_nfo - len(datas))) datas += cur[0].fetchall() maxtries = -4 if len(datas) < process_nfo: - cur[0].execute("SELECT id, guid, groupid, name from releases WHERE nzbstatus = 1 AND releasenfoid = 0 AND nfostatus = -5 "+groupid+" ORDER BY postdate DESC LIMIT "+str(process_nfo - len(datas))) + cur[0].execute("SELECT ID, guid, groupID, name from releases WHERE nzbstatus = 1 AND releasenfoID = 0 AND nfostatus = -5 "+groupID+" ORDER BY postdate DESC LIMIT "+str(process_nfo - len(datas))) datas += cur[0].fetchall() maxtries = -5 if len(datas) < process_nfo: - cur[0].execute("SELECT id, guid, groupid, name from releases WHERE nzbstatus = 1 AND releasenfoid = 0 AND nfostatus = -6 "+groupid+" ORDER BY postdate DESC LIMIT "+str(process_nfo - len(datas))) + cur[0].execute("SELECT ID, guid, groupID, name from releases WHERE nzbstatus = 1 AND releasenfoID = 0 AND nfostatus = -6 "+groupID+" ORDER BY postdate DESC LIMIT "+str(process_nfo - len(datas))) datas += cur[0].fetchall() maxtries = -6 elif sys.argv[1] == "movie" and len(sys.argv) == 3 and sys.argv[2] == "clean": - run = "SELECT DISTINCT searchname AS name, id, categoryid from releases WHERE nzbstatus = 1 AND isrenamed = 1 AND searchname IS NOT NULL AND imdbid IS NULL AND categoryid IN (SELECT id FROM category WHERE parentid = 2000) ORDER BY postdate DESC LIMIT %s" + run = "SELECT DISTINCT searchname AS name, ID, categoryID from releases WHERE nzbstatus = 1 AND isrenamed = 1 AND searchname IS NOT NULL AND imdbID IS NULL AND categoryID IN (SELECT ID FROM category WHERE parentID = 2000) ORDER BY postdate DESC LIMIT %s" cur[0].execute(run, (run_threads * movieperrun)) datas = cur[0].fetchall() elif sys.argv[1] == "movie": - run = "SELECT searchname AS name, id, categoryid from releases WHERE nzbstatus = 1 AND searchname IS NOT NULL AND imdbid IS NULL AND categoryid IN (SELECT id FROM category WHERE parentid = 2000) ORDER BY postdate DESC LIMIT %s" + run = "SELECT searchname AS name, ID, categoryID from releases WHERE nzbstatus = 1 AND searchname IS NOT NULL AND imdbID IS NULL AND categoryID IN (SELECT ID FROM category WHERE parentID = 2000) ORDER BY postdate DESC LIMIT %s" cur[0].execute(run, (run_threads * movieperrun)) datas = cur[0].fetchall() elif sys.argv[1] == "tv" and len(sys.argv) == 3 and sys.argv[2] == "clean": - run = "SELECT searchname, id from releases WHERE nzbstatus = 1 AND isrenamed = 1 AND searchname IS NOT NULL AND rageid = -1 AND categoryid IN (SELECT id FROM category WHERE parentid = 5000 ) "+orderBY+" LIMIT %s" + run = "SELECT searchname, ID from releases WHERE nzbstatus = 1 AND isrenamed = 1 AND searchname IS NOT NULL AND rageID = -1 AND categoryID IN (SELECT ID FROM category WHERE parentID = 5000 ) "+orderBY+" LIMIT %s" cur[0].execute(run, (run_threads * tvrageperrun)) datas = cur[0].fetchall() elif sys.argv[1] == "tv": - run = "SELECT searchname, id from releases WHERE nzbstatus = 1 AND searchname IS NOT NULL AND rageid = -1 AND categoryid IN (SELECT id FROM category WHERE parentid = 5000 ) "+orderBY+" LIMIT %s" + run = "SELECT searchname, ID from releases WHERE nzbstatus = 1 AND searchname IS NOT NULL AND rageID = -1 AND categoryID IN (SELECT ID FROM category WHERE parentID = 5000 ) "+orderBY+" LIMIT %s" cur[0].execute(run, (run_threads * tvrageperrun)) datas = cur[0].fetchall() @@ -225,14 +225,14 @@ class queue_runner(threading.Thread): while True: try: - my_id = self.my_queue.get(True, 1) + my_ID = self.my_queue.get(True, 1) except: if time.time() - time_of_last_run > 3: return else: - if my_id: + if my_ID: time_of_last_run = time.time() - subprocess.call(["php", pathname+"/../bin/postprocess_alpha.php", ""+my_id]) + subprocess.call(["php", pathname+"/../bin/postprocess_alpha.php", ""+my_ID]) time.sleep(.02) self.my_queue.task_done() @@ -289,11 +289,11 @@ def main(args): if sys.argv[1] == "nfo": cur = info.connect() - cur[0].execute("SELECT id from releases WHERE nfostatus <= -6") + cur[0].execute("SELECT ID from releases WHERE nfostatus <= -6") final = cur[0].fetchall() if len(datas) > 0: for item in final: - run = "DELETE FROM releasenfo WHERE nfo IS NULL AND releaseid = %s" + run = "DELETE FROM releasenfo WHERE nfo IS NULL AND releaseID = %s" cur[0].execute(run, (item[0])) final = cur[0].fetchall()