From 34bf090d5eebc11dbfe6120a44362f25b65e805c Mon Sep 17 00:00:00 2001 From: DariusIII Date: Wed, 1 Jan 2025 16:29:28 +0100 Subject: [PATCH] Update relationship --- Blacklight/Books.php | 6 +- Blacklight/Categorize.php | 2 +- Blacklight/CollectionsCleaning.php | 2 +- Blacklight/Console.php | 14 ++--- Blacklight/ElasticSearchSiteSearch.php | 2 +- Blacklight/Games.php | 4 +- Blacklight/IRCClient.php | 2 +- Blacklight/Movie.php | 4 +- Blacklight/Music.php | 18 +++--- Blacklight/NZB.php | 10 +-- Blacklight/NameFixer.php | 4 +- Blacklight/Nfo.php | 2 +- Blacklight/PopulateAniDB.php | 6 +- Blacklight/ReleaseCleaning.php | 62 +++++++++---------- Blacklight/ReleaseImage.php | 4 +- Blacklight/Releases.php | 2 +- Blacklight/TmuxOutput.php | 2 +- Blacklight/TmuxRun.php | 16 ++--- Blacklight/libraries/Forking.php | 60 +++++++++--------- Blacklight/processing/ProcessReleases.php | 4 +- .../processing/post/ProcessAdditional.php | 14 ++--- Blacklight/processing/tv/TMDB.php | 8 +-- Blacklight/processing/tv/TV.php | 8 +-- Blacklight/processing/tv/TVDB.php | 6 +- Blacklight/processing/tv/TVMaze.php | 20 +++--- Blacklight/processing/tv/TraktTv.php | 8 +-- .../Commands/NntmuxRemoveBadReleases.php | 2 +- app/Console/Commands/TmuxUIStart.php | 2 +- .../Controllers/Admin/AdminRoleController.php | 2 +- .../Controllers/Admin/AdminSiteController.php | 2 +- .../Controllers/Admin/AdminUserController.php | 2 +- app/Http/Controllers/SeriesController.php | 2 +- app/Models/Video.php | 6 ++ config/irc_settings.php | 2 +- misc/testing/NZB/nzb-reorg.php | 2 +- misc/testing/PostProc/getConsole.php | 2 +- misc/testing/PostProc/getGameCovers.php | 2 +- misc/testing/PostProc/getImdb.php | 2 +- misc/testing/PostProc/getMovieCovers.php | 2 +- misc/testing/PostProc/getTraktData.php | 2 +- misc/testing/PostProc/getXXXCovers.php | 2 +- misc/testing/PostProc/getXXXSamples.php | 2 +- misc/update/tmux/monitor.php | 56 ++++++++--------- misc/update/tmux/run.php | 6 +- rector.php | 2 +- .../smarty/plugins/modifier.fsize_format.php | 10 +-- .../plugins/modifier.phpdate_format.php | 4 +- routes/web.php | 2 +- 48 files changed, 206 insertions(+), 200 deletions(-) diff --git a/Blacklight/Books.php b/Blacklight/Books.php index 88fc5c310..59a9390fd 100755 --- a/Blacklight/Books.php +++ b/Blacklight/Books.php @@ -86,7 +86,7 @@ class Books public function getBookInfoByName(string $title): ?Model { - //only used to get a count of words + // only used to get a count of words $searchWords = ''; $title = preg_replace(['/( - | -|\(.+\)|\(|\))/', '/[^\w ]+/'], [' ', ''], $title); $title = trim(trim(preg_replace('/\s\s+/i', ' ', $title))); @@ -350,10 +350,10 @@ class Books $a = preg_replace('/\d{1,2} \d{1,2} \d{2,4}|(19|20)\d\d|anybody got .+?[a-z]\? |[ ._-](Novel|TIA)([ ._-]|$)|([ \.])HQ([-\. ])|[\(\)\.\-_ ](AVI|AZW3?|DOC|EPUB|LIT|MOBI|NFO|RETAIL|(si)?PDF|RTF|TXT)[\)\]\.\-_ ](?![a-z0-9])|compleet|DAGSTiDNiNGEN|DiRFiX|\+ extra|r?e ?Books?([\.\-_ ]English|ers)?|azw3?|ePu([bp])s?|html|mobi|^NEW[\.\-_ ]|PDF([\.\-_ ]English)?|Please post more|Post description|Proper|Repack(fix)?|[\.\-_ ](Chinese|English|French|German|Italian|Retail|Scan|Swedish)|^R4 |Repost|Skytwohigh|TIA!+|TruePDF|V413HAV|(would someone )?please (re)?post.+? "|with the authors name right/i', '', $release_name); $b = preg_replace('/^(As Req |conversion |eq |Das neue Abenteuer \d+|Fixed version( ignore previous post)?|Full |Per Req As Found|(\s+)?R4 |REQ |revised |version |\d+(\s+)?$)|(COMPLETE|INTERNAL|RELOADED| (AZW3|eB|docx|ENG?|exe|FR|Fix|gnv64|MU|NIV|R\d\s+\d{1,2} \d{1,2}|R\d|Req|TTL|UC|v(\s+)?\d))(\s+)?$/i', '', $a); - //remove book series from title as this gets more matches on amazon + // remove book series from title as this gets more matches on amazon $c = preg_replace('/ - \[.+\]|\[.+\]/', '', $b); - //remove any brackets left behind + // remove any brackets left behind $d = preg_replace('/(\(\)|\[\])/', '', $c); $releasename = trim(preg_replace('/\s\s+/i', ' ', $d)); diff --git a/Blacklight/Categorize.php b/Blacklight/Categorize.php index 8ea2627ea..f145a3f5c 100755 --- a/Blacklight/Categorize.php +++ b/Blacklight/Categorize.php @@ -137,7 +137,7 @@ class Categorize public function isOtherTV(): bool { if (preg_match('/[._ -]S\d{1,3}.+(EP\d{1,3}|Extras|SUBPACK)[._ -]|News/i', $this->releaseName) - //special case for "Have.I.Got.News.For.You" tv show + // special case for "Have.I.Got.News.For.You" tv show && ! preg_match('/[._ -]Got[._ -]News[._ -]For[._ -]You/i', $this->releaseName) ) { $this->tmpCat = Category::TV_OTHER; diff --git a/Blacklight/CollectionsCleaning.php b/Blacklight/CollectionsCleaning.php index d2ba8786d..14097ea71 100755 --- a/Blacklight/CollectionsCleaning.php +++ b/Blacklight/CollectionsCleaning.php @@ -186,7 +186,7 @@ class CollectionsCleaning */ protected function musicSubject(): bool|string { - //Broderick_Smith-Unknown_Country-2009-404 "00-broderick_smith-unknown_country-2009.sfv" yEnc + // Broderick_Smith-Unknown_Country-2009-404 "00-broderick_smith-unknown_country-2009.sfv" yEnc if (preg_match('/^(\w{10,}-[a-zA-Z0-9]+ ")\d\d-.+?" yEnc$/', $this->subject, $hit)) { return $hit[1]; } diff --git a/Blacklight/Console.php b/Blacklight/Console.php index 9eaa809c3..16b255c7b 100755 --- a/Blacklight/Console.php +++ b/Blacklight/Console.php @@ -114,7 +114,7 @@ class Console */ public function getConsoleInfoByName(string $title, string $platform) { - //only used to get a count of words + // only used to get a count of words $searchWords = ''; $title = preg_replace('/( - | -|\(.+\)|\(|\))/', ' ', $title); @@ -330,7 +330,7 @@ class Console // This actual compares the two strings and outputs a percentage value. $titlepercent = $platformpercent = ''; - //Remove import tags from console title for match + // Remove import tags from console title for match $con['title'] = trim(preg_replace('/([\[|\(]).{2,} import([\]|\)])$/i', '', $con['title'])); similar_text(strtolower($gameInfo['title']), strtolower($con['title']), $titlepercent); @@ -427,8 +427,8 @@ class Console $genreName = ''; if (isset($amaz->BrowseNodes)) { - //had issues getting this out of the browsenodes obj - //workaround is to get the xml and load that into its own obj + // had issues getting this out of the browsenodes obj + // workaround is to get the xml and load that into its own obj $amazGenresXml = $amaz->BrowseNodes->asXml(); $amazGenresObj = simplexml_load_string($amazGenresXml); $amazGenres = $amazGenresObj->xpath('//Name'); @@ -805,9 +805,9 @@ class Console // Replace dots, underscores, or brackets with spaces. $result['title'] = str_replace(['.', '_', '%20', '[', ']'], ' ', $title); $result['title'] = str_replace([' RF ', '.RF.', '-RF-', '_RF_'], ' ', $result['title']); - //Remove format tags from release title for match + // Remove format tags from release title for match $result['title'] = trim(preg_replace('/PAL|MULTI(\d)?|NTSC-?J?|\(JAPAN\)/i', '', $result['title'])); - //Remove disc tags from release title for match + // Remove disc tags from release title for match $result['title'] = trim(preg_replace('/Dis[ck] \d.*$/i', '', $result['title'])); // Needed to add code to handle DLC Properly. @@ -930,7 +930,7 @@ class Console { $str = ''; - //music nodes above mp3 download nodes + // music nodes above mp3 download nodes switch ($nodeName) { case 'Action_shooter': case 'Action_Games': diff --git a/Blacklight/ElasticSearchSiteSearch.php b/Blacklight/ElasticSearchSiteSearch.php index 8d17c4852..c58c1a753 100644 --- a/Blacklight/ElasticSearchSiteSearch.php +++ b/Blacklight/ElasticSearchSiteSearch.php @@ -277,7 +277,7 @@ class ElasticSearchSiteSearch // Execute a Scroll request and repeat $results = Elasticsearch::scroll([ - 'scroll_id' => $scroll_id, //...using our previously obtained _scroll_id + 'scroll_id' => $scroll_id, // ...using our previously obtained _scroll_id 'scroll' => '30s', // and the same timeout window ] ); diff --git a/Blacklight/Games.php b/Blacklight/Games.php index 073ee7a8f..944a6dc3a 100755 --- a/Blacklight/Games.php +++ b/Blacklight/Games.php @@ -344,7 +344,7 @@ class Games */ public function updateGamesInfo($gameInfo): bool { - //wait 10 seconds before proceeding (steam api limit) + // wait 10 seconds before proceeding (steam api limit) sleep(10); $gen = new Genres(['Settings' => null]); $ri = new ReleaseImage; @@ -769,7 +769,7 @@ class Games { $str = ''; - //Game genres + // Game genres switch ($gameGenre) { case 'Action': case 'Adventure': diff --git a/Blacklight/IRCClient.php b/Blacklight/IRCClient.php index 8932e5913..29094710b 100755 --- a/Blacklight/IRCClient.php +++ b/Blacklight/IRCClient.php @@ -301,7 +301,7 @@ class IRCClient return false; } } - //ERROR :Closing Link: kevin123[100.100.100.100] (This server is full.) + // ERROR :Closing Link: kevin123[100.100.100.100] (This server is full.) } elseif (preg_match('/^ERROR\s*:/', $this->_buffer)) { echo $this->_buffer.PHP_EOL; diff --git a/Blacklight/Movie.php b/Blacklight/Movie.php index 1c43209f8..c855f72b1 100755 --- a/Blacklight/Movie.php +++ b/Blacklight/Movie.php @@ -1059,7 +1059,7 @@ class Movie foreach ($res as $arr) { // Try to get a name/year. if (! $this->parseMovieSearchName($arr['searchname'])) { - //We didn't find a name, so set to all 0's so we don't parse again. + // We didn't find a name, so set to all 0's so we don't parse again. Release::query()->where('id', $arr['id'])->update(['imdbid' => 0000000]); continue; @@ -1191,7 +1191,7 @@ class Movie */ protected function localIMDBSearch() { - //If we found a year, try looking in a 4 year range. + // If we found a year, try looking in a 4 year range. $check = MovieInfo::query() ->where('title', 'like', '%'.$this->currentTitle.'%'); diff --git a/Blacklight/Music.php b/Blacklight/Music.php index bc85ad641..ef307127f 100755 --- a/Blacklight/Music.php +++ b/Blacklight/Music.php @@ -104,7 +104,7 @@ class Music */ public function getMusicInfoByName($artist, $album) { - //only used to get a count of words + // only used to get a count of words $searchwords = ''; $album = preg_replace('/( - | -|\(.+\)|\(|\))/', ' ', $album); $album = preg_replace('/[^\w ]+/', '', $album); @@ -507,7 +507,7 @@ class Music { $str = ''; - //music nodes above mp3 download nodes + // music nodes above mp3 download nodes switch ($nodeId) { case '163420': $str = 'Music Video & Concerts'; @@ -528,9 +528,9 @@ class Music case '624899011': $str = "Children's Music"; break; - case '173429': //christian - case '2231705011': //gospel - case '624905011': //christian & gospel + case '173429': // christian + case '2231705011': // gospel + case '624905011': // christian & gospel $str = 'Christian & Gospel'; break; case '67204': @@ -545,8 +545,8 @@ class Music case '624976011': $str = 'Country'; break; - case '7': //dance & electronic - case '624988011': //dance & dj + case '7': // dance & electronic + case '624988011': // dance & dj $str = 'Dance & Electronic'; break; case '32': @@ -557,8 +557,8 @@ class Music case '625011011': $str = 'Hard Rock & Metal'; break; - case '33': //world music - case '625021011': //international + case '33': // world music + case '625021011': // international $str = 'World Music'; break; case '34': diff --git a/Blacklight/NZB.php b/Blacklight/NZB.php index 19585e67d..13296039a 100755 --- a/Blacklight/NZB.php +++ b/Blacklight/NZB.php @@ -116,7 +116,7 @@ class NZB $XMLWriter->writeAttribute('type', 'name'); $XMLWriter->text($release->name); $XMLWriter->endElement(); - $XMLWriter->endElement(); //head + $XMLWriter->endElement(); // head foreach ($collections as $collection) { $binaries = Binary::whereCollectionsId($collection->id)->select(['id', 'name', 'totalparts'])->orderBy('name')->get(); @@ -151,7 +151,7 @@ class NZB } else { return false; } - $XMLWriter->endElement(); //groups + $XMLWriter->endElement(); // groups $XMLWriter->startElement('segments'); foreach ($parts as $part) { if ($nzb_guid === '') { @@ -163,12 +163,12 @@ class NZB $XMLWriter->text($part->messageid); $XMLWriter->endElement(); } - $XMLWriter->endElement(); //segments - $XMLWriter->endElement(); //file + $XMLWriter->endElement(); // segments + $XMLWriter->endElement(); // file } } $XMLWriter->writeComment($this->_siteCommentString); - $XMLWriter->endElement(); //nzb + $XMLWriter->endElement(); // nzb $XMLWriter->endDocument(); $path = ($this->buildNZBPath($release->guid, $this->nzbSplitLevel, true).$release->guid.'.nzb.gz'); $fp = gzopen($path, 'wb7'); diff --git a/Blacklight/NameFixer.php b/Blacklight/NameFixer.php index 906ef87c0..faeb2f997 100755 --- a/Blacklight/NameFixer.php +++ b/Blacklight/NameFixer.php @@ -728,7 +728,7 @@ class NameFixer } // 24 hours, all cats if ($time === 1 && $cats === 2) { $releases = Release::fromQuery($query.$this->timeall.$queryLimit); - } //other cats + } // other cats if ($time === 2 && $cats === 1) { $releases = Release::fromQuery($query.$this->fullother.$queryLimit); } // all cats @@ -1018,7 +1018,7 @@ class NameFixer return $matching; } - //Find release matches with fulltext and then identify exact matches with cleaned LIKE string + // Find release matches with fulltext and then identify exact matches with cleaned LIKE string $res = Release::fromQuery( sprintf( ' diff --git a/Blacklight/Nfo.php b/Blacklight/Nfo.php index 85b7e9c9a..58f7337a9 100755 --- a/Blacklight/Nfo.php +++ b/Blacklight/Nfo.php @@ -332,7 +332,7 @@ class Nfo Release::whereId($arr['id'])->update(['nfostatus' => self::NFO_FOUND]); $ret++; // Disable for now, we don't want to do full processing on nfo's. - /*$movie->doMovieUpdate($fetchedBinary, 'nfo', $arr['id'], $processImdb);*/ + /* $movie->doMovieUpdate($fetchedBinary, 'nfo', $arr['id'], $processImdb); */ // If set scan for tv info. // Disable for now, we don't want to do full processing on nfo's. diff --git a/Blacklight/PopulateAniDB.php b/Blacklight/PopulateAniDB.php index 40426af01..702bb4868 100644 --- a/Blacklight/PopulateAniDB.php +++ b/Blacklight/PopulateAniDB.php @@ -139,7 +139,7 @@ class PopulateAniDB } } - //start and end date come from AniDB API as date strings -- no manipulation needed + // start and end date come from AniDB API as date strings -- no manipulation needed $AniDBAPIArray['startdate'] = $AniDBAPIXML->startdate ?? '0000-00-00'; $AniDBAPIArray['enddate'] = $AniDBAPIXML->enddate ?? '0000-00-00'; @@ -283,8 +283,8 @@ class PopulateAniDB $animeTitles = new \SimpleXMLElement('compress.zlib://http://anidb.net/api/anime-titles.xml.gz', null, true); - //Even if the update process fails, - //we must mark the last update time or risk ban + // Even if the update process fails, + // we must mark the last update time or risk ban $this->setLastUpdated(); if ($animeTitles) { diff --git a/Blacklight/ReleaseCleaning.php b/Blacklight/ReleaseCleaning.php index 5a8c15b65..e98de4857 100755 --- a/Blacklight/ReleaseCleaning.php +++ b/Blacklight/ReleaseCleaning.php @@ -136,8 +136,8 @@ class ReleaseCleaning preg_match('/(\d{4,6}) -/', $subject, $hit) ) { $title = Predb::query()->where(['predb.requestid' => $hit[1], 'g.name' => $groupName])->join('usenet_groups as g', 'g.id', '=', 'predb.groups_id')->first(['predb.title', 'predb.id']); - //check for predb title matches against other groups where it matches relative size / fromname - //known crossposted requests only atm + // check for predb title matches against other groups where it matches relative size / fromname + // known crossposted requests only atm $reqGname = ''; switch ($groupName) { case 'alt.binaries.etc': @@ -189,7 +189,7 @@ class ReleaseCleaning ]; } - //if www.town.ag releases check against generic_town regexes + // if www.town.ag releases check against generic_town regexes if (preg_match('/www\.town\.ag$/i', $subject)) { return $this->generic_town(); } @@ -202,7 +202,7 @@ class ReleaseCleaning public function teevee(): array { - //[140022]-[04] - [01/40] - "140022-04.nfo" yEnc + // [140022]-[04] - [01/40] - "140022-04.nfo" yEnc if (preg_match('/\[\d+\]-\[.+\] - \[\d+\/\d+\] - "\d+\-.+" yEnc/', $this->subject)) { return [ 'cleansubject' => $this->subject, @@ -222,15 +222,15 @@ class ReleaseCleaning */ public function generic_town() { - // >> www.ssl-news.info <<< > [05/87] - "Deep.Black.Ass.5.XXX.1080p.WEBRip.x264-TBP.part03.rar" - 7,87 GB yEnc - // [02/24] - "Dragons.Den.UK.S11E02.HDTV.x264-ANGELiC.nfo" - 288,96 MB yEnc - // [6/6] - "TTT.Magazine.2013.08.vol0+1.par2" - 33,47 MB yEnc + // >> www.ssl-news.info <<< > [05/87] - "Deep.Black.Ass.5.XXX.1080p.WEBRip.x264-TBP.part03.rar" - 7,87 GB yEnc + // [02/24] - "Dragons.Den.UK.S11E02.HDTV.x264-ANGELiC.nfo" - 288,96 MB yEnc + // [6/6] - "TTT.Magazine.2013.08.vol0+1.par2" - 33,47 MB yEnc if (preg_match('/^.+?town\.ag.+?(www\..+?|News)\.[iI]nfo.+? \[\d+\/\d+\]( -)? "(.+?)(-sample)?'.$this->e0.' - \d+[.,]\d+ [kKmMgG][bB]M? yEnc$/', $this->subject, $hit)) { return $hit[3]; - } //[ TOWN ]-[ www.town.ag ]-[ partner of www.ssl-news.info ]-[ 1080p ] - [320/352] - "Gq7YGEWLy8wAA2NhbZx5LukEa.vol000+5.par2" - 17.09 GB yEnc + } // [ TOWN ]-[ www.town.ag ]-[ partner of www.ssl-news.info ]-[ 1080p ] - [320/352] - "Gq7YGEWLy8wAA2NhbZx5LukEa.vol000+5.par2" - 17.09 GB yEnc if (preg_match('/^\[\s*TOWN\s*\][\-_\s]{0,3}\[\s*www\.town\.ag\s*\][\-_\s]{0,3}\[\s*partner of www\.ssl-news\.info\s*\][\-_\s]{0,3}\[\s* .*\s*\][\-_\s]{0,3}\[\d+\/\d+\][\-_\s]{0,4}"([\w\säöüÄÖÜß+¤ƒ¶!.,&_()\[\]\'\`{}#-]{8,}?\b.?)'.$this->e2, $this->subject, $hit)) { return $hit[1]; - } // >> www.ssl-news.info <<< >IP Scanner Pro 3.21-Sebaro - [1/3] - "IP Scanner Pro 3.21-Sebaro.rar" yEnc + } // >> www.ssl-news.info <<< >IP Scanner Pro 3.21-Sebaro - [1/3] - "IP Scanner Pro 3.21-Sebaro.rar" yEnc if (preg_match( '/^.+?town\.ag.+?(www\..+?|News)\.[iI]nfo.+? \[\d+\/\d+\]( -)? "(.+?)(-sample)?'. $this->e1, @@ -239,7 +239,7 @@ class ReleaseCleaning ) ) { return $hit[3]; - } //(05/10) - - "D.Olivier.Wer Boeses.saet-gsx-.part4.rar" - 741,51 kB - yEnc + } // (05/10) - - "D.Olivier.Wer Boeses.saet-gsx-.part4.rar" - 741,51 kB - yEnc if (preg_match( '/^\(\d+\/\d+\) -\s+ - ("|#34;)([\w. ()-]{8,}?\b)(\.par2|-\.part\d+\.rar|\.nfo)("|#34;) - \d+[.,]\d+ [kKmMgG][bB]( -)? yEnc$/', $this->subject, @@ -247,7 +247,7 @@ class ReleaseCleaning ) ) { return $hit[2]; - } //[ TOWN ]-[ www.town.ag ]-[ partner of www.ssl-news.info ]-[ MOVIE ] [14/19] - "Night.Vision.2011.DVDRip.x264-IGUANA.part12.rar" - 660,80 MB yEnc + } // [ TOWN ]-[ www.town.ag ]-[ partner of www.ssl-news.info ]-[ MOVIE ] [14/19] - "Night.Vision.2011.DVDRip.x264-IGUANA.part12.rar" - 660,80 MB yEnc if (preg_match( '/^\[ TOWN \][ _-]{0,3}\[ www\.town\.ag \][ _-]{0,3}\[ partner of www\.ssl-news\.info \][ _-]{0,3}\[ .* \] \[\d+\/\d+\][ _-]{0,3}("|#34;)(.+)((\.part\d+\.rar)|(\.vol\d+\+\d+\.par2))("|#34;)[ _-]{0,3}\d+[.,]\d+ [kKmMgG][bB][ _-]{0,3}yEnc$/i', $this->subject, @@ -255,7 +255,7 @@ class ReleaseCleaning ) ) { return $hit[2]; - } //[ TOWN ]-[ www.town.ag ]-[ partner of www.ssl-news.info ]-[ MOVIE ] [01/84] - "The.Butterfly.Effect.2.2006.1080p.BluRay.x264-LCHD.par2" - 7,49 GB yEnc + } // [ TOWN ]-[ www.town.ag ]-[ partner of www.ssl-news.info ]-[ MOVIE ] [01/84] - "The.Butterfly.Effect.2.2006.1080p.BluRay.x264-LCHD.par2" - 7,49 GB yEnc if (preg_match( '/^\[ TOWN \][ _-]{0,3}\[ www\.town\.ag \][ _-]{0,3}\[ partner of www\.ssl-news\.info \][ _-]{0,3}\[ .* \] \[\d+\/\d+\][ _-]{0,3}("|#34;)(.+)\.(par2|rar|nfo|nzb)("|#34;)[ _-]{0,3}\d+[.,]\d+ [kKmMgG][bB][ _-]{0,3}yEnc$/i', $this->subject, @@ -263,7 +263,7 @@ class ReleaseCleaning ) ) { return $hit[2]; - } //[ TOWN ]-[ www.town.ag ]-[ partner of www.ssl-news.info ] [22/22] - "Arsenio.Hall.2013.09.11.Magic.Johnson.720p.HDTV.x264-2HD.vol31+11.par2" - 1,45 GB yEnc + } // [ TOWN ]-[ www.town.ag ]-[ partner of www.ssl-news.info ] [22/22] - "Arsenio.Hall.2013.09.11.Magic.Johnson.720p.HDTV.x264-2HD.vol31+11.par2" - 1,45 GB yEnc if (preg_match( '/^\[ TOWN \][ _-]{0,3}\[ www\.town\.ag \][ _-]{0,3}\[ partner of www\.ssl-news\.info \][ _-]{0,3}(\[ TV \] )?\[\d+\/\d+\][ _-]{0,3}("|#34;)(.+)((\.part\d+\.rar)|(\.vol\d+\+\d+\.par2)|\.nfo|\.vol\d+\+\.par2)("|#34;)[ _-]{0,3}\d+[.,]\d+ [kKmMgG][bB][ _-]{0,3}yEnc$/i', $this->subject, @@ -271,7 +271,7 @@ class ReleaseCleaning ) ) { return $hit[3]; - } //[ TOWN ]-[ www.town.ag ]-[ partner of www.ssl-news.info ] [01/28] - "Arsenio.Hall.2013.09.18.Dr.Phil.McGraw.HDTV.x264-2HD.par2" - 352,58 MB yEnc + } // [ TOWN ]-[ www.town.ag ]-[ partner of www.ssl-news.info ] [01/28] - "Arsenio.Hall.2013.09.18.Dr.Phil.McGraw.HDTV.x264-2HD.par2" - 352,58 MB yEnc if (preg_match( '/^\[ TOWN \][ _-]{0,3}\[ www\.town\.ag \][ _-]{0,3}\[ partner of www\.ssl-news\.info \][ _-]{0,3}(\[ TV \] )?\[\d+\/\d+\][ _-]{0,3}("|#34;)(.+)\.par2("|#34;)[ _-]{0,3}\d+[.,]\d+ [kKmMgG][bB][ _-]{0,3}yEnc$/i', $this->subject, @@ -279,7 +279,7 @@ class ReleaseCleaning ) ) { return $hit[3]; - } //4675.-.Wedding.Planner.multi3.(EU) [01/10] - "4675.-.Wedding.Planner.multi3.(EU).par2" - 72,80 MB - yEnc + } // 4675.-.Wedding.Planner.multi3.(EU) [01/10] - "4675.-.Wedding.Planner.multi3.(EU).par2" - 72,80 MB - yEnc if (preg_match( '/^\d+\.-\.(.+) \s+\s+<.+>\s+\[\d+\/\d+\] - ("|#34;).+("|#34;).+yEnc$/', $this->subject, @@ -288,7 +288,7 @@ class ReleaseCleaning ) { return $hit[1]; } - //4675.-.Wedding.Planner.multi3.(EU) [01/10] - "4675.-.Wedding.Planner.multi3.(EU).par2" - 72,80 MB - yEnc + // 4675.-.Wedding.Planner.multi3.(EU) [01/10] - "4675.-.Wedding.Planner.multi3.(EU).par2" - 72,80 MB - yEnc // Some have no yEnc if (preg_match( '/^\d+\.-\.(.+) \s+\s+<.+>\s+\[\d+\/\d+\] - ("|#34;).+/', @@ -297,7 +297,7 @@ class ReleaseCleaning ) ) { return $hit[1]; - } //Marco.Fehr.-.In.the.Mix.at.Der.Club-09-01-SAT-2012-XDS [01/13] - "Marco.Fehr.-.In.the.Mix.at.Der.Club-09-01-SAT-2012-XDS.par2" - 92,12 MB - yEnc + } // Marco.Fehr.-.In.the.Mix.at.Der.Club-09-01-SAT-2012-XDS [01/13] - "Marco.Fehr.-.In.the.Mix.at.Der.Club-09-01-SAT-2012-XDS.par2" - 92,12 MB - yEnc if (preg_match( '/^(\w.+) \s+\s+\[\d+\/\d+\] - ("|#34;).+("|#34;).+yEnc$/', $this->subject, @@ -306,7 +306,7 @@ class ReleaseCleaning ) { return $hit[1]; } - //Marco.Fehr.-.In.the.Mix.at.Der.Club-09-01-SAT-2012-XDS [01/13] - "Marco.Fehr.-.In.the.Mix.at.Der.Club-09-01-SAT-2012-XDS.par2" - 92,12 MB - yEnc + // Marco.Fehr.-.In.the.Mix.at.Der.Club-09-01-SAT-2012-XDS [01/13] - "Marco.Fehr.-.In.the.Mix.at.Der.Club-09-01-SAT-2012-XDS.par2" - 92,12 MB - yEnc // Some have no yEnc if (preg_match( '/^(\w.+) \s+\s+\[\d+\/\d+\] - ("|#34;).+/', @@ -315,7 +315,7 @@ class ReleaseCleaning ) ) { return $hit[1]; - } // JetBrains.IntelliJ.IDEA.v11.1.4.Ultimate.Edition.MacOSX.Incl.Keymaker-EMBRACE [01/18] - "JetBrains.IntelliJ.IDEA.v11.1.4.Ultimate.Edition.MacOSX.Incl.Keymaker-EMBRACE.par2" - 200,77 MB - yEnc + } // JetBrains.IntelliJ.IDEA.v11.1.4.Ultimate.Edition.MacOSX.Incl.Keymaker-EMBRACE [01/18] - "JetBrains.IntelliJ.IDEA.v11.1.4.Ultimate.Edition.MacOSX.Incl.Keymaker-EMBRACE.par2" - 200,77 MB - yEnc if (preg_match( '/^\s+\s+(.+)\s+\[\d+\/\d+\] - ("|#34;).+("|#34;).+yEnc$/', $this->subject, @@ -324,7 +324,7 @@ class ReleaseCleaning ) { return $hit[1]; } - // JetBrains.IntelliJ.IDEA.v11.1.4.Ultimate.Edition.MacOSX.Incl.Keymaker-EMBRACE [01/18] - "JetBrains.IntelliJ.IDEA.v11.1.4.Ultimate.Edition.MacOSX.Incl.Keymaker-EMBRACE.par2" - 200,77 MB - yEnc + // JetBrains.IntelliJ.IDEA.v11.1.4.Ultimate.Edition.MacOSX.Incl.Keymaker-EMBRACE [01/18] - "JetBrains.IntelliJ.IDEA.v11.1.4.Ultimate.Edition.MacOSX.Incl.Keymaker-EMBRACE.par2" - 200,77 MB - yEnc // Some have no yEnc if (preg_match( '/^\s+\s+(.+)\s+\[\d+\/\d+\] - ("|#34;).+/', @@ -333,7 +333,7 @@ class ReleaseCleaning ) ) { return $hit[1]; - } // [01/18] - "2012-11.-.Supurbia.-.Volume.Tw o.Digital-1920.K6-Empire.par2" - 421,98 MB yEnc + } // [01/18] - "2012-11.-.Supurbia.-.Volume.Tw o.Digital-1920.K6-Empire.par2" - 421,98 MB yEnc if (preg_match( '/^[ <\[]{0,2}TOWN[ >\]]{0,2}[ _-]{0,3}[ <\[]{0,2}www\.town\.ag[ >\]]{0,2}[ _-]{0,3}[ <\[]{0,2}partner of www.ssl-news\.info[ >\]]{0,2}[ _-]{0,3}\[\d+\/\d+\][ _-]{0,3}("|#34;)(.+)\.(par|vol|rar|nfo).*?("|#34;).+?yEnc$/i', $this->subject, @@ -341,7 +341,7 @@ class ReleaseCleaning ) ) { return $hit[2]; - } // www.town.ag > sponsored by www.ssl-news.info > (1/3) "HolzWerken_40.par2" - 43,89 MB - yEnc + } // www.town.ag > sponsored by www.ssl-news.info > (1/3) "HolzWerken_40.par2" - 43,89 MB - yEnc if (preg_match( '/^ www\.town\.ag > sponsored by www\.ssl-news\.info > \(\d+\/\d+\) "([\w\säöüÄÖÜß+¤ƒ¶!.,&_()\[\]\'\`{}#-]{8,}?\b.?)'. $this->e0.' - \d+[,.]\d+ [mMkKgG][bB] - yEnc$/', @@ -350,7 +350,7 @@ class ReleaseCleaning ) ) { return $hit[1]; - } //(1/9)<<>> sponsored by ssl-news.info<<<[HorribleSubs]_AIURA_-_01_[480p].mkv "[HorribleSubs]_AIURA_-_01_[480p].par2" yEnc + } // (1/9)<<>> sponsored by ssl-news.info<<<[HorribleSubs]_AIURA_-_01_[480p].mkv "[HorribleSubs]_AIURA_-_01_[480p].par2" yEnc if (preg_match( '/^\(\d+\/\d+\).+?www\.town\.ag.+?sponsored by (www\.)?ssl-news\.info<+?.+? "([\w\säöüÄÖÜß+¤ƒ¶!.,&_()\[\]\'\`{}#-]{8,}?\b.?)'. $this->e1, @@ -359,7 +359,7 @@ class ReleaseCleaning ) ) { return $hit[2]; - } //[ TOWN ]-[ www.town.ag ]-[ Assassins.Creed.IV.Black.Flag.XBOX360-COMPLEX ]-[ partner of www.ssl-news.info ] [074/195]- "complex-ac4.bf.d1.r71" yEnc + } // [ TOWN ]-[ www.town.ag ]-[ Assassins.Creed.IV.Black.Flag.XBOX360-COMPLEX ]-[ partner of www.ssl-news.info ] [074/195]- "complex-ac4.bf.d1.r71" yEnc if (preg_match( '/^\[ TOWN \][ _-]{0,3}\[ www\.town\.ag \][ _-]{0,3}\[ (.+?) \][ _-]{0,3}\[ partner of www\.ssl-news\.info \][ _-]{0,3}\[\d+\/(\d+\])[ _-]{0,3}"(.+)(\.part\d*|\.rar)?(\.vol.+ \(\d+\/\d+\) "|\.[A-Za-z0-9]{2,4}")[ _-]{0,3}yEnc$/i', $this->subject, @@ -367,7 +367,7 @@ class ReleaseCleaning ) ) { return $hit[1]; - } //(TOWN)(www.town.ag ) (partner of www.ssl-news.info ) Twinz-Conversation-CD-FLAC-1995-CUSTODES [01/23] - #34;Twinz-Conversation-CD-FLAC-1995-CUSTODES.par2#34; - 266,00 MB - yEnc + } // (TOWN)(www.town.ag ) (partner of www.ssl-news.info ) Twinz-Conversation-CD-FLAC-1995-CUSTODES [01/23] - #34;Twinz-Conversation-CD-FLAC-1995-CUSTODES.par2#34; - 266,00 MB - yEnc if (preg_match( '/^\(TOWN\)\(www\.town\.ag \)[ _-]{0,3}\(partner of www\.ssl-news\.info \)[ _-]{0,3} (.+?) \[\d+\/(\d+\][ _-]{0,3}("|#34;).+?)\.(par2|rar|nfo|nzb)("|#34;)[ _-]{0,3}\d+[.,]\d+ [kKmMgG][bB][ _-]{0,3}yEnc$/', $this->subject, @@ -375,7 +375,7 @@ class ReleaseCleaning ) ) { return $hit[1]; - } // Greek.S04E06.Katerstimmung.German.DL.Dubbed.WEB-DL.XviD-GEZ [01/22] - "Greek.S04E06.Katerstimmung.German.DL.Dubbed.WEB-DL.XviD-GEZ.par2" - 526,99 MB - yEnc + } // Greek.S04E06.Katerstimmung.German.DL.Dubbed.WEB-DL.XviD-GEZ [01/22] - "Greek.S04E06.Katerstimmung.German.DL.Dubbed.WEB-DL.XviD-GEZ.par2" - 526,99 MB - yEnc if (preg_match( '/^ (.+) \[\d+\/\d+\][ _-]{0,3}("|#34;).+?("|#34;).+?yEnc$/i', $this->subject, @@ -383,7 +383,7 @@ class ReleaseCleaning ) ) { return $hit[1]; - } //[ TOWN ]-[ www.town.ag ]-[ ANIME ] [01/17] - "[Chyuu] Nanatsu no Taizai - 12 [720p][D1F49539].par2" - 585,03 MB yEnc + } // [ TOWN ]-[ www.town.ag ]-[ ANIME ] [01/17] - "[Chyuu] Nanatsu no Taizai - 12 [720p][D1F49539].par2" - 585,03 MB yEnc if (preg_match( '/^\[ TOWN \][ _-]{0,3}\[ www\.town\.ag \][ _-]{0,3}\[ .* \][ _-]{0,3}\[\d+\/\d+\][ _-]{0,3}"([\w\säöüÄÖÜß+¤ƒ¶!.,&_()\[\]\'\`{}#-]{8,}?\b.?)'.$this->e2, $this->subject, @@ -433,17 +433,17 @@ class ReleaseCleaning */ public function fixerCleaner($name) { - //Extensions. + // Extensions. $cleanerName = preg_replace( '/([\-_](proof|sample|thumbs?))*(\.part\d*(\.rar)?|\.rar)?(\d{1,3}\.rev"|\.vol.+?"|\.[A-Za-z0-9]{2,4}$|$)/i', ' ', $name ); - //Remove stuff from the start. + // Remove stuff from the start. $cleanerName = preg_replace('/^(Release Name|sample-)/i', ' ', $cleanerName); - //Replace multiple spaces with 1 space + // Replace multiple spaces with 1 space $cleanerName = preg_replace('/\s\s+/i', ' ', $cleanerName); - //Remove invalid characters. + // Remove invalid characters. $cleanerName = trim(mb_convert_encoding(preg_replace('/[^(\x20-\x7F)]*/', '', $cleanerName), 'UTF-8', mb_list_encodings())); return $cleanerName; diff --git a/Blacklight/ReleaseImage.php b/Blacklight/ReleaseImage.php index 79358dabe..9a4097c7d 100755 --- a/Blacklight/ReleaseImage.php +++ b/Blacklight/ReleaseImage.php @@ -112,7 +112,7 @@ class ReleaseImage if ($saveThumb) { $cover->toJpeg(100)->save($imgSavePath.$imgName.'_thumb.jpg'); - //Optimize the thumbnail. + // Optimize the thumbnail. ImageOptimizer::optimize($imgSavePath.$imgName.'_thumb.jpg'); } } @@ -122,7 +122,7 @@ class ReleaseImage $coverPath = $imgSavePath.$imgName.'.jpg'; try { $cover->toJpeg(100)->save($coverPath); - //Optimize the image. + // Optimize the image. ImageOptimizer::optimize($coverPath); } catch (NotWritableException $e) { return 0; diff --git a/Blacklight/Releases.php b/Blacklight/Releases.php index 48f094777..b3a58ab48 100644 --- a/Blacklight/Releases.php +++ b/Blacklight/Releases.php @@ -368,7 +368,7 @@ class Releases extends Release try { Elasticsearch::delete($params); } catch (Missing404Exception $e) { - //we do nothing here just catch the error, we don't care if release is missing from ES, we are deleting it anyway + // we do nothing here just catch the error, we don't care if release is missing from ES, we are deleting it anyway } } } else { diff --git a/Blacklight/TmuxOutput.php b/Blacklight/TmuxOutput.php index 6e5f6356d..729c37ba0 100755 --- a/Blacklight/TmuxOutput.php +++ b/Blacklight/TmuxOutput.php @@ -45,7 +45,7 @@ class TmuxOutput extends Tmux $buffer .= $this->_getQueries(); } - //begin update display with screen clear + // begin update display with screen clear passthru('clear'); echo $buffer; } diff --git a/Blacklight/TmuxRun.php b/Blacklight/TmuxRun.php index c0126d249..69506810f 100755 --- a/Blacklight/TmuxRun.php +++ b/Blacklight/TmuxRun.php @@ -319,8 +319,8 @@ class TmuxRun extends Tmux */ protected function _runNonUpdateBinaries(&$runVar): void { - //run update_binaries - //$color = $this->get_color($runVar['settings']['colors_start'], $runVar['settings']['colors_end'], $runVar['settings']['colors_exc']); + // run update_binaries + // $color = $this->get_color($runVar['settings']['colors_start'], $runVar['settings']['colors_end'], $runVar['settings']['colors_exc']); if (((int) $runVar['settings']['binaries_run'] !== 0) && ($runVar['killswitch']['pp'] === false)) { $log = $this->writelog($runVar['panes']['zero'][2]); shell_exec( @@ -341,7 +341,7 @@ class TmuxRun extends Tmux */ protected function _runNonBackfill(&$runVar): void { - //run backfill + // run backfill $backsleep = ( (int) $runVar['settings']['progressive'] === 1 && floor($runVar['counts']['now']['collections_table'] / 500) > $runVar['settings']['back_timer'] ? floor($runVar['counts']['now']['collections_table'] / 500) @@ -368,7 +368,7 @@ class TmuxRun extends Tmux */ protected function _runNonUpdateReleases(&$runVar): void { - //run update_releases + // run update_releases if ((int) $runVar['settings']['releases_run'] !== 0) { $log = $this->writelog($runVar['panes']['zero'][4]); shell_exec( @@ -409,7 +409,7 @@ class TmuxRun extends Tmux $runVar['timers']['timer3'] = time(); break; case ((int) $runVar['settings']['post'] === 3) && (((int) $runVar['counts']['now']['processnfo'] > 0) || ((int) $runVar['counts']['now']['work'] > 0)): - //run postprocess_releases additional + // run postprocess_releases additional $log = $this->writelog($runVar['panes']['two'][0]); shell_exec( "tmux respawnp -t{$runVar['constants']['tmux_session']}:2.0 ' \ @@ -460,7 +460,7 @@ class TmuxRun extends Tmux $runVar['modsettings']['fc']['time'] = 'full'; } - //Check to see if the pane is dead, if so respawn it. + // Check to see if the pane is dead, if so respawn it. if (shell_exec("tmux list-panes -t{$runVar['constants']['tmux_session']}:1 | grep ^1 | grep -c dead") == 1) { // Run remove crap releases. shell_exec( @@ -556,7 +556,7 @@ class TmuxRun extends Tmux shell_exec("tmux respawnp -t{$runVar['constants']['tmux_session']}:0.2 '$binaries $backfill $releases $date $sleep' 2>&1 1> /dev/null"); } elseif (($runVar['killswitch']['pp'] === false) && (time() - $runVar['timers']['timer5'] >= 4800)) { - //run backfill all once and resets the timer + // run backfill all once and resets the timer if ((int) $runVar['settings']['backfill'] !== 0) { shell_exec( "tmux respawnp -t{$runVar['constants']['tmux_session']}:0.2 ' \ @@ -632,7 +632,7 @@ class TmuxRun extends Tmux protected function _runIRCScraper($pane, &$runVar): void { if ((int) $runVar['constants']['run_ircscraper'] === 1) { - //Check to see if the pane is dead, if so respawn it. + // Check to see if the pane is dead, if so respawn it. if ((int) shell_exec("tmux list-panes -t{$runVar['constants']['tmux_session']}:{$pane} | grep ^0 | grep -c dead") === 1) { shell_exec( "tmux respawnp -t{$runVar['constants']['tmux_session']}:{$pane}.0 ' \ diff --git a/Blacklight/libraries/Forking.php b/Blacklight/libraries/Forking.php index 21b6e796d..c869281ea 100755 --- a/Blacklight/libraries/Forking.php +++ b/Blacklight/libraries/Forking.php @@ -248,9 +248,9 @@ class Forking } } - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////// All backFill code here //////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // ////////////////////////////////////// All backFill code here //////////////////////////////////////////////////// + // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// private function backfill(): void { @@ -274,7 +274,7 @@ class Forking })->catch(function (\Throwable $exception) { echo $exception->getMessage(); })->catch(static function (SerializableException $serializableException) { - //we do nothing here just catch the error and move on + // we do nothing here just catch the error and move on }); $maxWork--; } @@ -369,7 +369,7 @@ class Forking })->catch(function (\Throwable $exception) { echo $exception->getMessage(); })->catch(static function (SerializableException $serializableException) { - //we do nothing here just catch the error and move on + // we do nothing here just catch the error and move on }); } $pool->wait(); @@ -380,9 +380,9 @@ class Forking } } - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////// All binaries code here //////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // ////////////////////////////////////// All binaries code here //////////////////////////////////////////////////// + // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// private function binaries(): void { @@ -409,7 +409,7 @@ class Forking })->catch(function (\Throwable $exception) { echo $exception->getMessage(); })->catch(static function (SerializableException $serializableException) { - //we do nothing here just catch the error and move on + // we do nothing here just catch the error and move on }); $maxWork--; } @@ -443,7 +443,7 @@ class Forking $queues[$i] = sprintf('update_group_headers %s', $group->groupname); $i++; } else { - //only process if more than 20k headers available and skip the first 20k + // only process if more than 20k headers available and skip the first 20k $count = $group->their_last - $group->our_last - 20000; if ($count <= $maxMessages * 2) { $queues[$i] = sprintf('update_group_headers %s', $group->groupname); @@ -457,7 +457,7 @@ class Forking $queues[$i] = sprintf('get_range binaries %s %s %s %s', $group->groupname, $group->our_last + $j * $maxMessages + 1, $group->our_last + $j * $maxMessages + $maxMessages, $i); $i++; } - //add remainder to queue + // add remainder to queue $queues[$i] = sprintf('get_range binaries %s %s %s %s', $group->groupname, $group->our_last + ($j + 1) * $maxMessages + 1, $group->our_last + ($j + 1) * $maxMessages + $remaining + 1, $i); $i++; } @@ -478,7 +478,7 @@ class Forking })->catch(function (\Throwable $exception) { echo $exception->getMessage(); })->catch(static function (SerializableException $serializableException) { - //we do nothing here just catch the error and move on + // we do nothing here just catch the error and move on }); } @@ -486,9 +486,9 @@ class Forking } } - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////// All fix release names code here /////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // ////////////////////////////////// All fix release names code here /////////////////////////////////////////////// + // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// private function fixRelNames(): void { @@ -548,16 +548,16 @@ class Forking })->catch(function (\Throwable $exception) { echo $exception->getMessage(); })->catch(static function (SerializableException $serializableException) { - //we do nothing here just catch the error and move on + // we do nothing here just catch the error and move on }); $maxWork--; } $pool->wait(); } - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////// All releases code here //////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // ////////////////////////////////////// All releases code here //////////////////////////////////////////////////// + // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// private function releases(): void { @@ -594,7 +594,7 @@ class Forking })->catch(function (\Throwable $exception) { echo $exception->getMessage(); })->catch(static function (SerializableException $serializableException) { - //we do nothing here just catch the error and move on + // we do nothing here just catch the error and move on }); $maxWork--; } @@ -602,9 +602,9 @@ class Forking $pool->wait(); } - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////// All post process code here ///////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // ///////////////////////////////////// All post process code here ///////////////////////////////////////////////// + // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** * Only 1 exit method is used for post process, since they are all similar. @@ -638,7 +638,7 @@ class Forking })->catch(function (\Throwable $exception) { echo $exception->getMessage(); })->catch(static function (SerializableException $serializableException) { - //we do nothing here just catch the error and move on + // we do nothing here just catch the error and move on })->timeout(function () use ($count) { $this->colorCli->notice('Task #'.$count.': Timeout occurred.'); }); @@ -849,9 +849,9 @@ class Forking $postProcess->processXXX(); } - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - ///////////////////////////////// All "update_per_Group" code goes here //////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // /////////////////////////////// All "update_per_Group" code goes here //////////////////////////////////////////// + // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** * @throws \Exception @@ -881,9 +881,9 @@ class Forking $pool->wait(); } - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////// Various methods /////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // ////////////////////////////////////////// Various methods /////////////////////////////////////////////////////// + // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// protected function _executeCommand(string $command): string { diff --git a/Blacklight/processing/ProcessReleases.php b/Blacklight/processing/ProcessReleases.php index 49f6c0aad..4bdce8288 100755 --- a/Blacklight/processing/ProcessReleases.php +++ b/Blacklight/processing/ProcessReleases.php @@ -477,10 +477,10 @@ class ProcessReleases if (preg_match_all('#(\S+):\S+#', $collection->xref, $hits)) { foreach ($hits[1] as $grp) { - //check if the group name is in a valid format + // check if the group name is in a valid format $grpTmp = UsenetGroup::isValidGroup($grp); if ($grpTmp !== false) { - //check if the group already exists in database + // check if the group already exists in database $xrefGrpID = UsenetGroup::getIDByName($grpTmp); if ($xrefGrpID === '') { $xrefGrpID = UsenetGroup::addGroup( diff --git a/Blacklight/processing/post/ProcessAdditional.php b/Blacklight/processing/post/ProcessAdditional.php index d3d23e591..be9f7c713 100755 --- a/Blacklight/processing/post/ProcessAdditional.php +++ b/Blacklight/processing/post/ProcessAdditional.php @@ -1043,7 +1043,7 @@ class ProcessAdditional } $this->_releaseHasPassword = true; $this->_passwordStatus = Releases::PASSWD_RAR; - } //Run a PreDB filename check on insert to try and match the release + } // Run a PreDB filename check on insert to try and match the release elseif ($file['name'] !== '' && ! str_starts_with($file['name'], '.')) { $this->_release['filename'] = $file['name']; $this->_release['releases_id'] = $this->_release->id; @@ -1577,7 +1577,7 @@ class ProcessAdditional if (config('app.debug') === true) { Log::error($e->getTraceAsString()); } - //We do nothing, just prevent displaying errors because the file cannot be open(corrupted or incomplete file) + // We do nothing, just prevent displaying errors because the file cannot be open(corrupted or incomplete file) } } @@ -1685,17 +1685,17 @@ class ProcessAdditional if (config('app.debug') === true) { Log::error($runtimeException->getTraceAsString()); } - //We show no error we just log it, we failed to save the frame and move on + // We show no error we just log it, we failed to save the frame and move on } catch (\InvalidArgumentException $e) { if (config('app.debug') === true) { Log::error($e->getTraceAsString()); } - //We do nothing, just prevent displaying errors because the file cannot be open(corrupted or incomplete file) + // We do nothing, just prevent displaying errors because the file cannot be open(corrupted or incomplete file) } catch (\Throwable $e) { if (config('app.debug') === true) { Log::error($e->getTraceAsString()); } - //Again we do nothing, we just want to catch the error + // Again we do nothing, we just want to catch the error } } @@ -1780,7 +1780,7 @@ class ProcessAdditional if (config('app.debug') === true) { Log::error($e->getTraceAsString()); } - //We do nothing, just prevent displaying errors because the file cannot be open(corrupted or incomplete file) + // We do nothing, just prevent displaying errors because the file cannot be open(corrupted or incomplete file) } } } @@ -1799,7 +1799,7 @@ class ProcessAdditional if (config('app.debug') === true) { Log::error($e->getTraceAsString()); } - //We do nothing, just prevent displaying errors because the file cannot be open(corrupted or incomplete file) + // We do nothing, just prevent displaying errors because the file cannot be open(corrupted or incomplete file) } } diff --git a/Blacklight/processing/tv/TMDB.php b/Blacklight/processing/tv/TMDB.php index 71ed1bc3a..b40d695c9 100644 --- a/Blacklight/processing/tv/TMDB.php +++ b/Blacklight/processing/tv/TMDB.php @@ -158,17 +158,17 @@ class TMDB extends TV $this->colorCli->climate()->info('Found TMDB Match!'); } } else { - //Processing failed, set the episode ID to the next processing group + // Processing failed, set the episode ID to the next processing group $this->setVideoIdFound($videoId, $row['id'], 0); $this->setVideoNotFound(parent::PROCESS_TRAKT, $row['id']); } } else { - //Processing failed, set the episode ID to the next processing group + // Processing failed, set the episode ID to the next processing group $this->setVideoNotFound(parent::PROCESS_TRAKT, $row['id']); $this->titleCache[] = $release['cleanname'] ?? null; } } else { - //Processing failed, set the episode ID to the next processing group + // Processing failed, set the episode ID to the next processing group $this->setVideoNotFound(parent::PROCESS_TRAKT, $row['id']); $this->titleCache[] = $release['cleanname'] ?? null; } @@ -294,7 +294,7 @@ class TMDB extends TV sleep(1); - //Handle Single Episode Lookups + // Handle Single Episode Lookups if (\is_array($response) && $this->checkRequiredAttr($response, 'tmdbE')) { $return = $this->formatEpisodeInfo($response); } diff --git a/Blacklight/processing/tv/TV.php b/Blacklight/processing/tv/TV.php index cbabda36b..b827e3d7f 100755 --- a/Blacklight/processing/tv/TV.php +++ b/Blacklight/processing/tv/TV.php @@ -452,7 +452,7 @@ abstract class TV extends Videos $episodeArr['season'] = (int) $hits[2]; $episodeArr['episode'] = [(int) $hits[3], (int) $hits[4]]; } - //S01E0102 and S01E01E02 - lame no delimit numbering, regex would collide if there was ever 1000 ep season. + // S01E0102 and S01E01E02 - lame no delimit numbering, regex would collide if there was ever 1000 ep season. elseif (preg_match('/^(.*?)[^a-z0-9]s(\d{2})[^a-z0-9]?e(\d{2})e?(\d{2})[^a-z0-9]?/i', $relname, $hits)) { $episodeArr['season'] = (int) $hits[2]; $episodeArr['episode'] = (int) $hits[3]; @@ -481,13 +481,13 @@ abstract class TV extends Videos elseif (preg_match('/^(.*?)[^a-z0-9](?P(19|20)(\d{2})[.\/-](\d{2})[.\/-](\d{2}))[^a-z0-9]?/i', $relname, $hits)) { $episodeArr['season'] = $hits[4].$hits[5]; $episodeArr['episode'] = $hits[5].'/'.$hits[6]; - $episodeArr['airdate'] = date('Y-m-d', strtotime(preg_replace('/[^0-9]/i', '/', $hits['airdate']))); //yyyy-mm-dd + $episodeArr['airdate'] = date('Y-m-d', strtotime(preg_replace('/[^0-9]/i', '/', $hits['airdate']))); // yyyy-mm-dd } // 01.01.2009 elseif (preg_match('/^(.*?)[^a-z0-9](?P(\d{2})[^a-z0-9](\d{2})[^a-z0-9](19|20)(\d{2}))[^a-z0-9]?/i', $relname, $hits)) { $episodeArr['season'] = $hits[5].$hits[6]; $episodeArr['episode'] = $hits[3].'/'.$hits[4]; - $episodeArr['airdate'] = date('Y-m-d', strtotime(preg_replace('/[^0-9]/i', '/', $hits['airdate']))); //yyyy-mm-dd + $episodeArr['airdate'] = date('Y-m-d', strtotime(preg_replace('/[^0-9]/i', '/', $hits['airdate']))); // yyyy-mm-dd } // 01.01.09 elseif (preg_match('/^(.*?)[^a-z0-9](\d{2})[^a-z0-9](\d{2})[^a-z0-9](\d{2})[^a-z0-9]?/i', $relname, $hits)) { @@ -495,7 +495,7 @@ abstract class TV extends Videos $episodeArr['season'] = $hits[4] = ($hits[4] <= 99 && $hits[4] > 15) ? '19'.$hits[4] : '20'.$hits[4]; $episodeArr['episode'] = $hits[2].'/'.$hits[3]; $tmpAirdate = $episodeArr['season'].'/'.$episodeArr['episode']; - $episodeArr['airdate'] = date('Y-m-d', strtotime(preg_replace('/[^0-9]/i', '/', $tmpAirdate))); //yyyy-mm-dd + $episodeArr['airdate'] = date('Y-m-d', strtotime(preg_replace('/[^0-9]/i', '/', $tmpAirdate))); // yyyy-mm-dd } // 2009.E01 elseif (preg_match('/^(.*?)[^a-z0-9]20(\d{2})[^a-z0-9](\d{1,3})[^a-z0-9]?/i', $relname, $hits)) { diff --git a/Blacklight/processing/tv/TVDB.php b/Blacklight/processing/tv/TVDB.php index aab1d75fd..900f9530a 100755 --- a/Blacklight/processing/tv/TVDB.php +++ b/Blacklight/processing/tv/TVDB.php @@ -179,17 +179,17 @@ class TVDB extends TV $this->colorCli->climate()->info('Found TVDB Match!'); } } else { - //Processing failed, set the episode ID to the next processing group + // Processing failed, set the episode ID to the next processing group $this->setVideoIdFound($videoId, $row['id'], 0); $this->setVideoNotFound(parent::PROCESS_TVMAZE, $row['id']); } } else { - //Processing failed, set the episode ID to the next processing group + // Processing failed, set the episode ID to the next processing group $this->setVideoNotFound(parent::PROCESS_TVMAZE, $row['id']); $this->titleCache[] = $release['cleanname'] ?? null; } } else { - //Parsing failed, take it out of the queue for examination + // Parsing failed, take it out of the queue for examination $this->setVideoNotFound(parent::FAILED_PARSE, $row['id']); $this->titleCache[] = $release['cleanname'] ?? null; } diff --git a/Blacklight/processing/tv/TVMaze.php b/Blacklight/processing/tv/TVMaze.php index 2bc86a600..026662f40 100644 --- a/Blacklight/processing/tv/TVMaze.php +++ b/Blacklight/processing/tv/TVMaze.php @@ -83,7 +83,7 @@ class TVMaze extends TV $videoId = $this->getByTitle($release['cleanname'], parent::TYPE_TV, parent::SOURCE_TVMAZE); // Force local lookup only - //$local = true, $lookupsetting = false and vice versa + // $local = true, $lookupsetting = false and vice versa $lookupSetting = $local !== true; if ($videoId === 0 && $lookupSetting) { @@ -164,17 +164,17 @@ class TVMaze extends TV $this->colorCli->climate()->info('Found TVMaze Match!', true); } } else { - //Processing failed, set the episode ID to the next processing group + // Processing failed, set the episode ID to the next processing group $this->setVideoIdFound($videoId, $row['id'], 0); $this->setVideoNotFound(parent::PROCESS_TMDB, $row['id']); } } else { - //Processing failed, set the episode ID to the next processing group + // Processing failed, set the episode ID to the next processing group $this->setVideoNotFound(parent::PROCESS_TMDB, $row['id']); $this->titleCache[] = $release['cleanname'] ?? null; } } else { - //Processing failed, set the episode ID to the next processing group + // Processing failed, set the episode ID to the next processing group $this->setVideoNotFound(parent::PROCESS_TMDB, $row['id']); $this->titleCache[] = $release['cleanname'] ?? null; } @@ -192,7 +192,7 @@ class TVMaze extends TV { $return = $response = false; - //Try for the best match with AKAs embedded + // Try for the best match with AKAs embedded $response = $this->client->getShowBySiteID($site, $siteId); sleep(1); @@ -216,7 +216,7 @@ class TVMaze extends TV // Do this for the API Search only as a local lookup should require it $name = preg_replace('# \((19|20)\d{2}\)$#', '', $name); - //Try for the best match with AKAs embedded + // Try for the best match with AKAs embedded $response = $this->client->singleSearchAkas($name); sleep(1); @@ -225,13 +225,13 @@ class TVMaze extends TV $return = $this->matchShowInfo($response, $name); } if ($return === false) { - //Try for the best match via full search (no AKAs can be returned but the search is better) + // Try for the best match via full search (no AKAs can be returned but the search is better) $response = $this->client->search($name); if (\is_array($response)) { $return = $this->matchShowInfo($response, $name); } } - //If we didn't get any aliases do a direct alias lookup + // If we didn't get any aliases do a direct alias lookup if (\is_array($return) && empty($return['aliases']) && is_numeric($return['tvmaze'])) { $return['aliases'] = $this->client->getShowAKAs($return['tvmaze']); } @@ -321,13 +321,13 @@ class TVMaze extends TV sleep(1); - //Handle Single Episode Lookups + // Handle Single Episode Lookups if (\is_object($response)) { if ($this->checkRequiredAttr($response, 'tvmazeE')) { $return = $this->formatEpisodeInfo($response); } } elseif (\is_array($response)) { - //Handle new show/all episodes and airdate lookups + // Handle new show/all episodes and airdate lookups foreach ($response as $singleEpisode) { if ($this->checkRequiredAttr($singleEpisode, 'tvmazeE')) { // If this is an airdate lookup and it matches the airdate, set a return diff --git a/Blacklight/processing/tv/TraktTv.php b/Blacklight/processing/tv/TraktTv.php index 1321718f1..649bc4807 100755 --- a/Blacklight/processing/tv/TraktTv.php +++ b/Blacklight/processing/tv/TraktTv.php @@ -120,7 +120,7 @@ class TraktTv extends TV if ((int) $videoId > 0 && (int) $traktid > 0) { // Now that we have valid video and trakt ids, try to get the poster - //$this->getPoster($videoId, $traktid); + // $this->getPoster($videoId, $traktid); $seasonNo = preg_replace('/^S0*/i', '', $release['season']); $episodeNo = preg_replace('/^E0*/i', '', $release['episode']); @@ -156,17 +156,17 @@ class TraktTv extends TV $this->colorCli->climate()->info('Found TRAKT Match!'); } } else { - //Processing failed, set the episode ID to the next processing group + // Processing failed, set the episode ID to the next processing group $this->setVideoIdFound($videoId, $row['id'], 0); $this->setVideoNotFound(parent::PROCESS_IMDB, $row['id']); } } else { - //Processing failed, set the episode ID to the next processing group + // Processing failed, set the episode ID to the next processing group $this->setVideoNotFound(parent::PROCESS_IMDB, $row['id']); $this->titleCache[] = $release['cleanname'] ?? null; } } else { - //Processing failed, set the episode ID to the next processing group + // Processing failed, set the episode ID to the next processing group $this->setVideoNotFound(parent::PROCESS_IMDB, $row['id']); $this->titleCache[] = $release['cleanname'] ?? null; } diff --git a/app/Console/Commands/NntmuxRemoveBadReleases.php b/app/Console/Commands/NntmuxRemoveBadReleases.php index 7e967c924..f611bb8f1 100644 --- a/app/Console/Commands/NntmuxRemoveBadReleases.php +++ b/app/Console/Commands/NntmuxRemoveBadReleases.php @@ -61,7 +61,7 @@ class NntmuxRemoveBadReleases extends Command try { Elasticsearch::delete($params); } catch (Missing404Exception $e) { - //we do nothing here just catch the error, we don't care if release is missing from ES, we are deleting it anyway + // we do nothing here just catch the error, we don't care if release is missing from ES, we are deleting it anyway } } else { $identifiers = [ diff --git a/app/Console/Commands/TmuxUIStart.php b/app/Console/Commands/TmuxUIStart.php index 7154cedcb..119e9b5aa 100644 --- a/app/Console/Commands/TmuxUIStart.php +++ b/app/Console/Commands/TmuxUIStart.php @@ -34,7 +34,7 @@ class TmuxUIStart extends Command // Set running value to on. $tmux->startRunning(); - //check if session exists + // check if session exists $session = Process::run("tmux list-session | grep $tmux_session"); if ($session->exitCode() === 1) { $this->info('Starting the tmux server and monitor script'); diff --git a/app/Http/Controllers/Admin/AdminRoleController.php b/app/Http/Controllers/Admin/AdminRoleController.php index dcc47943f..333bf7902 100644 --- a/app/Http/Controllers/Admin/AdminRoleController.php +++ b/app/Http/Controllers/Admin/AdminRoleController.php @@ -17,7 +17,7 @@ class AdminRoleController extends BasePageController $meta_title = $title = 'User Role List'; - //get the user roles + // get the user roles $userroles = Role::cursor()->remember(); $this->smarty->assign('userroles', $userroles); diff --git a/app/Http/Controllers/Admin/AdminSiteController.php b/app/Http/Controllers/Admin/AdminSiteController.php index 8ed860247..7d86b330b 100644 --- a/app/Http/Controllers/Admin/AdminSiteController.php +++ b/app/Http/Controllers/Admin/AdminSiteController.php @@ -81,7 +81,7 @@ class AdminSiteController extends BasePageController $this->smarty->assign('passwd_ids', [1, 0]); $this->smarty->assign('passwd_names', ['Deep (requires unrar)', 'None']); - /*0 = English, 2 = Danish, 3 = French, 1 = German*/ + /* 0 = English, 2 = Danish, 3 = French, 1 = German */ $this->smarty->assign('langlist_ids', [0, 2, 3, 1]); $this->smarty->assign('langlist_names', ['English', 'Danish', 'French', 'German']); diff --git a/app/Http/Controllers/Admin/AdminUserController.php b/app/Http/Controllers/Admin/AdminUserController.php index 6606c0db9..804244ca4 100644 --- a/app/Http/Controllers/Admin/AdminUserController.php +++ b/app/Http/Controllers/Admin/AdminUserController.php @@ -99,7 +99,7 @@ class AdminUserController extends BasePageController // set the current action $action = $request->input('action') ?? 'view'; - //get the user roles + // get the user roles $userRoles = Role::cursor()->remember(); $roles = []; $defaultRole = 'User'; diff --git a/app/Http/Controllers/SeriesController.php b/app/Http/Controllers/SeriesController.php index 53675c609..103c32950 100644 --- a/app/Http/Controllers/SeriesController.php +++ b/app/Http/Controllers/SeriesController.php @@ -63,7 +63,7 @@ class SeriesController extends BasePageController $this->smarty->assign('show', $show); $this->smarty->assign('myshows', $myshows); - //get series name(s), description, country and genre + // get series name(s), description, country and genre $seriestitles = $seriessummary = $seriescountry = []; $seriestitles[] = $show['title']; diff --git a/app/Models/Video.php b/app/Models/Video.php index 648ec343c..06409d712 100644 --- a/app/Models/Video.php +++ b/app/Models/Video.php @@ -5,6 +5,7 @@ namespace App\Models; use Illuminate\Contracts\Pagination\LengthAwarePaginator; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Database\Eloquent\Relations\HasOne; /** * App\Models\Video. @@ -78,6 +79,11 @@ class Video extends Model return $this->hasMany(TvEpisode::class, 'videos_id'); } + public function tvInfo(): HasOne + { + return $this->hasOne(TvInfo::class, 'videos_id'); + } + /** * Get info from tables for the provided ID. * diff --git a/config/irc_settings.php b/config/irc_settings.php index 7fbaa948f..7b42238f1 100644 --- a/config/irc_settings.php +++ b/config/irc_settings.php @@ -74,7 +74,7 @@ return [ 'scrape_irc_channels' => serialize( [ - //'#Channel' => 'Password', + // '#Channel' => 'Password', '#PreNNTmux' => null, '#nZEDbPRE' => null, ] diff --git a/misc/testing/NZB/nzb-reorg.php b/misc/testing/NZB/nzb-reorg.php index 523e25d00..39664342c 100755 --- a/misc/testing/NZB/nzb-reorg.php +++ b/misc/testing/NZB/nzb-reorg.php @@ -22,7 +22,7 @@ $iFilesProcessed = $iFilesCounted = 0; $time = now()->toImmutable(); echo "\nReorganizing files to Level $newLevel from: $sourcePath This could take a while...\n"; -//$consoleTools = new \ConsoleTools(); +// $consoleTools = new \ConsoleTools(); foreach ($objects as $filestoprocess => $nzbFile) { if ($nzbFile->getExtension() != 'gz') { continue; diff --git a/misc/testing/PostProc/getConsole.php b/misc/testing/PostProc/getConsole.php index 6089a414d..9d9e865ac 100644 --- a/misc/testing/PostProc/getConsole.php +++ b/misc/testing/PostProc/getConsole.php @@ -1,6 +1,6 @@ getConstantSettings())); -//assign shell commands +// assign shell commands $runVar['commands']['_php'] = " nice -n{$tmux_niceness} php"; $runVar['commands']['_phpn'] = "nice -n{$tmux_niceness} php"; $runVar['commands']['_sleep'] = "{$runVar['commands']['_phpn']} {$runVar['paths']['misc']}update/tmux/bin/showsleep.php"; -//spawn IRCScraper as soon as possible +// spawn IRCScraper as soon as possible try { $tRun->runPane('scraper', $runVar); } catch (Exception $e) { echo $e; } -//get list of panes by name +// get list of panes by name $runVar['panes'] = $tRun->getListOfPanes($runVar['constants']); -//totals per category in db, results by parentID +// totals per category in db, results by parentID $catCountQuery = 'SELECT c.root_categories_id AS parentid, COUNT(r.id) AS count FROM categories c, releases r WHERE r.categories_id = c.id GROUP BY c.root_categories_id'; -//create timers and set to now +// create timers and set to now $runVar['timers']['timer1'] = $runVar['timers']['timer2'] = $runVar['timers']['timer3'] = $runVar['timers']['timer4'] = $runVar['timers']['timer5'] = time(); @@ -80,12 +80,12 @@ while ($runVar['counts']['iterations'] > 0) { $runVar['settings']['book_reqids'] = (! empty($runVar['settings']['book_reqids']) ? $runVar['settings']['book_reqids'] : Category::BOOKS_ROOT); - //get usenet connection info + // get usenet connection info $runVar['connections'] = $tOut->getConnectionsInfo($runVar['constants']); $runVar['constants']['pre_lim'] = ($runVar['counts']['iterations'] > 1 ? '7' : ''); - //assign scripts + // assign scripts $runVar['scripts']['releases'] = "{$runVar['commands']['_php']} {$runVar['paths']['misc']}update/multiprocessing/releases.php"; $runVar['scripts']['binaries'] = match ((int) $runVar['settings']['binaries_run']) { @@ -101,7 +101,7 @@ while ($runVar['counts']['iterations'] > 0) { $runVar['scripts']['backfill'] = "{$runVar['commands']['_php']} {$runVar['paths']['misc']}update/multiprocessing/safe.php backfill"; } - //get usenet connection counts + // get usenet connection counts unset($runVar['conncounts']); $runVar['conncounts'] = $tOut->getUSPConnections('primary', $runVar['connections']); @@ -109,7 +109,7 @@ while ($runVar['counts']['iterations'] > 0) { $runVar['conncounts'] += $tOut->getUSPConnections('alternate', $runVar['connections']); } - //run queries only after time exceeded, these queries can take awhile + // run queries only after time exceeded, these queries can take awhile if ((int) $runVar['counts']['iterations'] === 1 || (time() - $runVar['timers']['timer2'] >= $runVar['settings']['monitor'] && (int) $runVar['settings']['is_running'] === 1)) { $runVar['counts']['proc1'] = $runVar['counts']['proc2'] = $runVar['counts']['proc3'] = $splitQry = $newOldQry = false; $runVar['counts']['now']['total_work'] = 0; @@ -132,7 +132,7 @@ while ($runVar['counts']['iterations'] > 0) { $splitRes = (array) Arr::first(DB::select($splitQry)); $runVar['timers']['newOld'] = (array) Arr::first(DB::select($newOldQry)); - //assign split query results to main var + // assign split query results to main var foreach ($splitRes as $splitKey => $split) { $runVar['counts']['now'][$splitKey] = $split; } @@ -232,7 +232,7 @@ while ($runVar['counts']['iterations'] > 0) { } $runVar['timers']['newOld']['oldestcollection'] = $age; - //free up memory used by now stale data + // free up memory used by now stale data unset($age, $added, $tables); $runVar['timers']['query']['tpg_time'] = (time() - $timer07); @@ -240,7 +240,7 @@ while ($runVar['counts']['iterations'] > 0) { } $runVar['timers']['timer2'] = time(); - //assign postprocess values from $proc + // assign postprocess values from $proc if (is_array($proc1res)) { foreach ($proc1res as $proc1key => $proc1) { $runVar['counts']['now'][$proc1key] = $proc1; @@ -270,21 +270,21 @@ while ($runVar['counts']['iterations'] > 0) { } } - //set initial start postproc values from work queries -- this is used to determine diff variables + // set initial start postproc values from work queries -- this is used to determine diff variables if ((int) $runVar['counts']['iterations'] === 1) { $runVar['counts']['start'] = $runVar['counts']['now']; } foreach ($runVar['counts']['now'] as $key => $proc) { - //if key is a process type, add it to total_work + // if key is a process type, add it to total_work if (str_starts_with($key, 'process')) { $runVar['counts']['now']['total_work'] += $proc; } - //calculate diffs + // calculate diffs $runVar['counts']['diff'][$key] = number_format($proc - $runVar['counts']['start'][$key]); - //calculate percentages -- if user has no releases, set 0 for each key or this will fail on divide by zero + // calculate percentages -- if user has no releases, set 0 for each key or this will fail on divide by zero $runVar['counts']['percent'][$key] = $runVar['counts']['now']['releases'] > 0 ? sprintf('%02s', floor(($proc / $runVar['counts']['now']['releases']) * 100)) : 0; } @@ -300,59 +300,59 @@ while ($runVar['counts']['iterations'] > 0) { $runVar['counts']['diff']['total_work'] = number_format($runVar['counts']['now']['total_work'] - $runVar['counts']['start']['total_work']); } - //set kill switches + // set kill switches $runVar['killswitch']['pp'] = (($runVar['settings']['postprocess_kill'] < $runVar['counts']['now']['total_work']) && ((int) $runVar['settings']['postprocess_kill'] !== 0)); $runVar['killswitch']['coll'] = (($runVar['settings']['collections_kill'] < $runVar['counts']['now']['collections_table']) && ((int) $runVar['settings']['collections_kill'] !== 0)); $tOut->updateMonitorPane($runVar); - //begin pane run execution + // begin pane run execution if ($runVar['settings']['is_running'] === '1') { - //run main updating function(s) + // run main updating function(s) try { $tRun->runPane('main', $runVar); } catch (Exception $e) { echo $e; } - //run nzb-import + // run nzb-import try { $tRun->runPane('import', $runVar); } catch (Exception $e) { echo $e; } - //run postprocess_releases amazon + // run postprocess_releases amazon try { $tRun->runPane('amazon', $runVar); } catch (Exception $e) { echo $e; } - //respawn IRCScraper if it has been killed + // respawn IRCScraper if it has been killed try { $tRun->runPane('scraper', $runVar); } catch (Exception $e) { echo $e; } - //update tv and theaters + // update tv and theaters try { $tRun->runPane('updatetv', $runVar); } catch (Exception $e) { echo $e; } - //run these if complete sequential not set + // run these if complete sequential not set if ((int) $runVar['constants']['sequential'] !== 2) { - //fix names + // fix names try { $tRun->runPane('fixnames', $runVar); } catch (Exception $e) { echo $e; } - //dehash releases + // dehash releases try { $tRun->runPane('dehash', $runVar); } catch (Exception $e) { @@ -366,14 +366,14 @@ while ($runVar['counts']['iterations'] > 0) { echo $e; } - //run postprocess_releases additional + // run postprocess_releases additional try { $tRun->runPane('ppadditional', $runVar); } catch (Exception $e) { echo $e; } - //run postprocess_releases non amazon + // run postprocess_releases non amazon try { $tRun->runPane('nonamazon', $runVar); } catch (Exception $e) { diff --git a/misc/update/tmux/run.php b/misc/update/tmux/run.php index 49e3a50ea..adfa1446c 100644 --- a/misc/update/tmux/run.php +++ b/misc/update/tmux/run.php @@ -17,7 +17,7 @@ $colorCli = new ColorCLI; Process::run('clear'); -//reset collections dateadded to now if dateadded > delay time check +// reset collections dateadded to now if dateadded > delay time check $colorCli->header('Resetting collections that have expired to this moment. This could take some time if many collections need to be reset'); DB::transaction(function () use ($delaytime) { @@ -31,7 +31,7 @@ function command_exist($cmd): bool return $returnVal->seeInOutput($cmd); } -//check for apps +// check for apps $apps = ['time', 'tmux', 'nice', 'tee']; foreach ($apps as &$value) { if (! command_exist($value)) { @@ -126,7 +126,7 @@ function attach($tmuxPath, $tmux_session): void Process::run("tmux select-window -t $tmux_session:0; tmux attach-session -d -t $tmux_session"); } -//create tmux session +// create tmux session $tmuxConfig = $tmuxPath.'tmux.conf'; diff --git a/rector.php b/rector.php index 9d29ff6f6..76764f88c 100644 --- a/rector.php +++ b/rector.php @@ -21,7 +21,7 @@ return static function (RectorConfig $rectorConfig): void { ]); // register a single rule - //$rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class); + // $rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class); // define sets of rules $rectorConfig->sets([ diff --git a/resources/smarty/plugins/modifier.fsize_format.php b/resources/smarty/plugins/modifier.fsize_format.php index da83c0516..30682579d 100755 --- a/resources/smarty/plugins/modifier.fsize_format.php +++ b/resources/smarty/plugins/modifier.fsize_format.php @@ -47,11 +47,11 @@ function smarty_modifier_fsize_format($size, $format = '', $precision = 2, $dec_ $sizes['YB'] = $sizes['ZB'] * $b; $sizes = array_reverse($sizes, true); } - //~ get "human" filesize + // ~ get "human" filesize foreach ($sizes as $unit => $bytes) { if ($size > $bytes || $unit == $format) { - //~ return formatted size + // ~ return formatted size return number_format($size / $bytes, $precision, $dec_point, $thousands_sep).' '.$unit; - } //~ end if - } //~ end foreach -} //~ end function + } // ~ end if + } // ~ end foreach +} // ~ end function diff --git a/resources/smarty/plugins/modifier.phpdate_format.php b/resources/smarty/plugins/modifier.phpdate_format.php index dbb222b10..70ff7372a 100755 --- a/resources/smarty/plugins/modifier.phpdate_format.php +++ b/resources/smarty/plugins/modifier.phpdate_format.php @@ -75,7 +75,7 @@ function smarty_modifier_phpdate_format($string, $format = 'Y/m/d H:i:s', $defau case 'DATE_ISO8601': $nformat = DATE_ISO8601; break; case 'DATE_RFC822': $nformat = 'D, d M y H:i:s O'; - break; //The php constant is not quite right - as the time-zone comes out with invalid values like "UTC"... + break; // The php constant is not quite right - as the time-zone comes out with invalid values like "UTC"... case 'DATE_RFC850': $nformat = DATE_RFC850; break; case 'DATE_RFC1036': $nformat = DATE_RFC1036; @@ -87,7 +87,7 @@ function smarty_modifier_phpdate_format($string, $format = 'Y/m/d H:i:s', $defau case 'DATE_RFC3339': $nformat = DATE_RFC3339; break; case 'DATE_RSS': $nformat = 'D, d M Y H:i:s O'; - break; //as rfc822 ... + break; // as rfc822 ... case 'DATE_W3C': $nformat = DATE_W3C; break; } diff --git a/routes/web.php b/routes/web.php index d9edcabb2..d90a7428a 100644 --- a/routes/web.php +++ b/routes/web.php @@ -69,7 +69,7 @@ use App\Http\Controllers\SearchController; use App\Http\Controllers\SeriesController; use App\Http\Controllers\TermsController; -//Auth::routes(); +// Auth::routes(); Route::match(['GET', 'POST'], '/', [ContentController::class, 'show'])->name('home');