From ad1a6673f54cb7346845f6bd03a96fe40e63014f Mon Sep 17 00:00:00 2001 From: DariusIII Date: Wed, 1 Jan 2020 23:03:32 +0000 Subject: [PATCH] Apply fixes from StyleCI [ci skip] [skip ci] --- Blacklight/IRCScraper.php | 42 ++--- Blacklight/NameFixer.php | 20 +-- Blacklight/ReleaseExtra.php | 60 +++---- Blacklight/ReleaseRemover.php | 8 +- Blacklight/Releases.php | 39 ++-- Blacklight/processing/tv/TMDB.php | 50 +++--- Blacklight/processing/tv/TV.php | 34 ++-- Blacklight/processing/tv/TraktTv.php | 50 +++--- app/Console/Commands/FixturesUp.php | 18 +- app/Console/Commands/NntmuxResetDb.php | 12 +- app/Extensions/util/Git.php | 10 +- .../Controllers/Auth/RegisterController.php | 4 +- app/Models/Predb.php | 5 +- app/Models/ReleaseFile.php | 16 +- app/Models/UsenetGroup.php | 26 +-- app/Transformers/TagsTransformer.php | 2 +- config/fixtures.php | 2 +- config/ide-helper.php | 4 +- config/irc_settings.php | 40 ++--- config/nntmux_nntp.php | 24 +-- config/services.php | 2 +- config/sphinxsearch.php | 2 +- config/tagging.php | 2 +- config/ytake-laravel-smarty.php | 168 +++++++++--------- misc/elasticsearch/create_es_indexes.php | 15 +- misc/manticoresearch/populate_rt_indexes.php | 22 +-- misc/update/tmux/bin/update_groups.php | 10 +- 27 files changed, 338 insertions(+), 349 deletions(-) diff --git a/Blacklight/IRCScraper.php b/Blacklight/IRCScraper.php index 22d9f705b..31eb77f23 100755 --- a/Blacklight/IRCScraper.php +++ b/Blacklight/IRCScraper.php @@ -77,27 +77,27 @@ class IRCScraper extends IRCClient $this->_ignoredChannels = unserialize( config('irc_settings.scrape_irc_source_ignore'), ['allowed_classes' => ['#a.b.cd.image', - '#a.b.console.ps3', - '#a.b.dvd', - '#a.b.erotica', - '#a.b.flac', - '#a.b.foreign', - '#a.b.games.nintendods', - '#a.b.inner-sanctum', - '#a.b.moovee', - '#a.b.movies.divx', - '#a.b.sony.psp', - '#a.b.sounds.mp3.complete_cd', - '#a.b.teevee', - '#a.b.games.wii', - '#a.b.warez', - '#a.b.games.xbox360', - '#pre@corrupt', - '#scnzb', - '#tvnzb', - 'srrdb', - ], - ] + '#a.b.console.ps3', + '#a.b.dvd', + '#a.b.erotica', + '#a.b.flac', + '#a.b.foreign', + '#a.b.games.nintendods', + '#a.b.inner-sanctum', + '#a.b.moovee', + '#a.b.movies.divx', + '#a.b.sony.psp', + '#a.b.sounds.mp3.complete_cd', + '#a.b.teevee', + '#a.b.games.wii', + '#a.b.warez', + '#a.b.games.xbox360', + '#pre@corrupt', + '#scnzb', + '#tvnzb', + 'srrdb', + ], + ] ); } else { $this->_ignoredChannels = [ diff --git a/Blacklight/NameFixer.php b/Blacklight/NameFixer.php index ba6457d4a..12fcbf0fa 100755 --- a/Blacklight/NameFixer.php +++ b/Blacklight/NameFixer.php @@ -1309,9 +1309,9 @@ class NameFixer 'multi_match' => [ 'query' => $preMatch[1], 'fields' => ['filename', 'title'], - ] - ] - ] + ], + ], + ], ]; $primaryResults = \Elasticsearch::search($search); @@ -2505,9 +2505,9 @@ class NameFixer 'multi_match' => [ 'query' => $this->_fileName, 'fields' => ['filename', 'title'], - ] - ] - ] + ], + ], + ], ]; $primaryResults = \Elasticsearch::search($search); @@ -2561,9 +2561,9 @@ class NameFixer 'multi_match' => [ 'query' => $this->_fileName, 'fields' => ['filename', 'title'], - ] - ] - ] + ], + ], + ], ]; $primaryResults = \Elasticsearch::search($search); @@ -2582,7 +2582,7 @@ class NameFixer } } else { foreach ($this->sphinx->searchIndexes('predb_rt', $this->_fileName, ['title']) as $match) { - if (!empty($match)) { + if (! empty($match)) { $this->updateRelease($release, $match['title'], 'PreDb: Title match', $echo, $type, $nameStatus, $show, $match['id']); return true; diff --git a/Blacklight/ReleaseExtra.php b/Blacklight/ReleaseExtra.php index fcc9b87e9..15e4eb13e 100755 --- a/Blacklight/ReleaseExtra.php +++ b/Blacklight/ReleaseExtra.php @@ -295,18 +295,18 @@ class ReleaseExtra $ckid = VideoData::query()->where('releases_id', $releaseID)->first(['releases_id']); if ($ckid === null) { VideoData::insertOrIgnore([ - 'releases_id' => $releaseID, - 'containerformat' => $containerFormat, - 'overallbitrate' => $overallBitRate, - 'videoduration' => is_numeric($videoDuration) ? realDuration($videoDuration) : $videoDuration, - 'videoformat' => $videoFormat, - 'videocodec' => $videoCodec, - 'videowidth' => $videoWidth, - 'videoheight' => $videoHeight, - 'videoaspect' => $videoAspect, - 'videoframerate' => $videoFrameRate, - 'videolibrary' => $videoLibrary, - ]); + 'releases_id' => $releaseID, + 'containerformat' => $containerFormat, + 'overallbitrate' => $overallBitRate, + 'videoduration' => is_numeric($videoDuration) ? realDuration($videoDuration) : $videoDuration, + 'videoformat' => $videoFormat, + 'videocodec' => $videoCodec, + 'videowidth' => $videoWidth, + 'videoheight' => $videoHeight, + 'videoaspect' => $videoAspect, + 'videoframerate' => $videoFrameRate, + 'videolibrary' => $videoLibrary, + ]); } } @@ -328,18 +328,18 @@ class ReleaseExtra $ckid = AudioData::query()->where('releases_id', $releaseID)->first(['releases_id']); if ($ckid === null) { AudioData::insertOrIgnore([ - 'releases_id' => $releaseID, - 'audioid' => $audioID, - 'audioformat' => \is_array($audioFormat) ? implode($audioFormat) : $audioFormat, - 'audiomode' => \is_array($audioMode) ? implode($audioMode) : $audioMode, - 'audiobitratemode' => \is_array($audioBitRateMode) ? implode($audioBitRateMode) : $audioBitRateMode, - 'audiobitrate' => \is_array($audioBitRate) ? implode($audioBitRate) : $audioBitRate, - 'audiochannels' => \is_array($audioChannels) ? implode($audioChannels) : $audioChannels, - 'audiosamplerate' => \is_array($audioSampleRate) ? implode($audioSampleRate) : $audioSampleRate, - 'audiolibrary' => \is_array($audioLibrary) ? implode($audioLibrary) : $audioLibrary, - 'audiolanguage' => ! empty($audioLanguage) ? $audioLanguage[1] : '', - 'audiotitle' => \is_array($audioTitle) ? implode($audioTitle) : $audioTitle, - ]); + 'releases_id' => $releaseID, + 'audioid' => $audioID, + 'audioformat' => \is_array($audioFormat) ? implode($audioFormat) : $audioFormat, + 'audiomode' => \is_array($audioMode) ? implode($audioMode) : $audioMode, + 'audiobitratemode' => \is_array($audioBitRateMode) ? implode($audioBitRateMode) : $audioBitRateMode, + 'audiobitrate' => \is_array($audioBitRate) ? implode($audioBitRate) : $audioBitRate, + 'audiochannels' => \is_array($audioChannels) ? implode($audioChannels) : $audioChannels, + 'audiosamplerate' => \is_array($audioSampleRate) ? implode($audioSampleRate) : $audioSampleRate, + 'audiolibrary' => \is_array($audioLibrary) ? implode($audioLibrary) : $audioLibrary, + 'audiolanguage' => ! empty($audioLanguage) ? $audioLanguage[1] : '', + 'audiotitle' => \is_array($audioTitle) ? implode($audioTitle) : $audioTitle, + ]); } } @@ -375,14 +375,14 @@ class ReleaseExtra public function addUID($releaseID, $uniqueId): void { $dupecheck = ReleaseUnique::query()->where('releases_id', $releaseID)->orWhere([ - 'releases_id' => $releaseID, - 'uniqueid' => $uniqueId, - ])->first(['releases_id']); + 'releases_id' => $releaseID, + 'uniqueid' => $uniqueId, + ])->first(['releases_id']); if ($dupecheck === null) { ReleaseUnique::insertOrIgnore([ - 'releases_id' => $releaseID, - 'uniqueid' => $uniqueId, - ]); + 'releases_id' => $releaseID, + 'uniqueid' => $uniqueId, + ]); } } diff --git a/Blacklight/ReleaseRemover.php b/Blacklight/ReleaseRemover.php index e391514cb..308d9d16a 100755 --- a/Blacklight/ReleaseRemover.php +++ b/Blacklight/ReleaseRemover.php @@ -1364,10 +1364,10 @@ class ReleaseRemover str_replace( ['-', '(', ')', '.', '?', 'nl subed|bed|s'], [ - '', - '', - '', - ' ', '', 'nlsubs|nlsubbed|nlsubed', ], + '', + '', + '', + ' ', '', 'nlsubs|nlsubbed|nlsubed', ], substr( $dbRegex, $forBegin, diff --git a/Blacklight/Releases.php b/Blacklight/Releases.php index b682d1993..97ada6e8f 100755 --- a/Blacklight/Releases.php +++ b/Blacklight/Releases.php @@ -461,7 +461,6 @@ class Releases extends Release } } if ($identifiers['i'] !== false) { - $params = [ 'index' => 'releases', 'id' => $identifiers['i'], @@ -592,8 +591,8 @@ class Releases extends Release 'body' => [ 'query' => [ 'match' => $searchFields, - ] - ] + ], + ], ]; $results = \Elasticsearch::search($search); @@ -601,7 +600,6 @@ class Releases extends Release $searchResult = []; foreach ($results['hits']['hits'] as $result) { $searchResult[] = $result['_source']['id']; - } } else { $results = $this->sphinxSearch->searchIndexes('releases_rt', '', [], $searchFields); @@ -710,8 +708,8 @@ class Releases extends Release 'match' => [ 'searchname' => $searchName, ], - ] - ] + ], + ], ]; $results = \Elasticsearch::search($search); @@ -719,7 +717,6 @@ class Releases extends Release $searchResult = []; foreach ($results['hits']['hits'] as $result) { $searchResult[] = $result['_source']['id']; - } } else { $searchResult = Arr::pluck($this->sphinxSearch->searchIndexes('releases_rt', $searchName, ['searchname']), 'id'); @@ -874,10 +871,10 @@ class Releases extends Release 'body' => [ 'query' => [ 'match' => [ - 'searchname' => $name + 'searchname' => $name, ], - ] - ] + ], + ], ]; $results = \Elasticsearch::search($search); @@ -885,7 +882,6 @@ class Releases extends Release $searchResult = []; foreach ($results['hits']['hits'] as $result) { $searchResult[] = $result['_source']['id']; - } if (empty($searchResult)) { return collect(); @@ -1043,10 +1039,10 @@ class Releases extends Release 'body' => [ 'query' => [ 'match' => [ - 'searchname' => $name + 'searchname' => $name, ], - ] - ] + ], + ], ]; $results = \Elasticsearch::search($search); @@ -1054,7 +1050,6 @@ class Releases extends Release $searchResult = []; foreach ($results['hits']['hits'] as $result) { $searchResult[] = $result['_source']['id']; - } if (empty($searchResult)) { return collect(); @@ -1148,10 +1143,10 @@ class Releases extends Release 'body' => [ 'query' => [ 'match' => [ - 'searchname' => $name + 'searchname' => $name, ], - ] - ] + ], + ], ]; $results = \Elasticsearch::search($search); @@ -1159,7 +1154,6 @@ class Releases extends Release $searchResult = []; foreach ($results['hits']['hits'] as $result) { $searchResult[] = $result['_source']['id']; - } if (empty($searchResult)) { return collect(); @@ -1253,10 +1247,10 @@ class Releases extends Release 'body' => [ 'query' => [ 'match' => [ - 'searchname' => $name + 'searchname' => $name, ], - ] - ] + ], + ], ]; $results = \Elasticsearch::search($search); @@ -1264,7 +1258,6 @@ class Releases extends Release $searchResult = []; foreach ($results['hits']['hits'] as $result) { $searchResult[] = $result['_source']['id']; - } if (empty($searchResult)) { return collect(); diff --git a/Blacklight/processing/tv/TMDB.php b/Blacklight/processing/tv/TMDB.php index e84569436..03e716738 100755 --- a/Blacklight/processing/tv/TMDB.php +++ b/Blacklight/processing/tv/TMDB.php @@ -51,10 +51,10 @@ class TMDB extends TV parent::__construct($options); $this->token = new ApiToken(config('tmdb.api_key')); $this->client = new Client($this->token, [ - 'cache' => [ - 'enabled' => false, - ], - ] + 'cache' => [ + 'enabled' => false, + ], + ] ); $this->configRepository = new ConfigurationRepository($this->client); $this->config = $this->configRepository->load(); @@ -372,21 +372,21 @@ class TMDB extends TV } return [ - 'type' => parent::TYPE_TV, - 'title' => (string) $show['name'], - 'summary' => (string) $show['overview'], - 'started' => (string) $show['first_air_date'], - 'publisher' => isset($show['network']) ? (string) $show['network'] : '', - 'country' => $show['origin_country'][0] ?? '', - 'source' => parent::SOURCE_TMDB, - 'imdb' => isset($imdb['imdbid']) ? (int) $imdb['imdbid'] : 0, - 'tvdb' => isset($show['external_ids']['tvdb_id']) ? (int) $show['external_ids']['tvdb_id'] : 0, - 'trakt' => 0, - 'tvrage' => isset($show['external_ids']['tvrage_id']) ? (int) $show['external_ids']['tvrage_id'] : 0, - 'tvmaze' => 0, - 'tmdb' => (int) $show['id'], - 'aliases' => ! empty($show['alternative_titles']) ? (array) $show['alternative_titles'] : '', - 'localzone' => "''", + 'type' => parent::TYPE_TV, + 'title' => (string) $show['name'], + 'summary' => (string) $show['overview'], + 'started' => (string) $show['first_air_date'], + 'publisher' => isset($show['network']) ? (string) $show['network'] : '', + 'country' => $show['origin_country'][0] ?? '', + 'source' => parent::SOURCE_TMDB, + 'imdb' => isset($imdb['imdbid']) ? (int) $imdb['imdbid'] : 0, + 'tvdb' => isset($show['external_ids']['tvdb_id']) ? (int) $show['external_ids']['tvdb_id'] : 0, + 'trakt' => 0, + 'tvrage' => isset($show['external_ids']['tvrage_id']) ? (int) $show['external_ids']['tvrage_id'] : 0, + 'tvmaze' => 0, + 'tmdb' => (int) $show['id'], + 'aliases' => ! empty($show['alternative_titles']) ? (array) $show['alternative_titles'] : '', + 'localzone' => "''", ]; } @@ -401,12 +401,12 @@ class TMDB extends TV protected function formatEpisodeInfo($episode): array { return [ - 'title' => (string) $episode['name'], - 'series' => (int) $episode['season_number'], - 'episode' => (int) $episode['episode_number'], - 'se_complete' => 'S'.sprintf('%02d', $episode['season_number']).'E'.sprintf('%02d', $episode['episode_number']), - 'firstaired' => (string) $episode['air_date'], - 'summary' => (string) $episode['overview'], + 'title' => (string) $episode['name'], + 'series' => (int) $episode['season_number'], + 'episode' => (int) $episode['episode_number'], + 'se_complete' => 'S'.sprintf('%02d', $episode['season_number']).'E'.sprintf('%02d', $episode['episode_number']), + 'firstaired' => (string) $episode['air_date'], + 'summary' => (string) $episode['overview'], ]; } } diff --git a/Blacklight/processing/tv/TV.php b/Blacklight/processing/tv/TV.php index 9806f83bb..0a1d72c8e 100755 --- a/Blacklight/processing/tv/TV.php +++ b/Blacklight/processing/tv/TV.php @@ -236,25 +236,25 @@ abstract class TV extends Videos if ($title === null) { // Insert the Show $videoId = Video::query()->insertGetId([ - 'type' => $show['type'], - 'title' => $show['title'], - 'countries_id' => $show['country'] ?? '', - 'started' => $show['started'], - 'source' => $show['source'], - 'tvdb' => $show['tvdb'], - 'trakt' => $show['trakt'], - 'tvrage' => $show['tvrage'], - 'tvmaze' => $show['tvmaze'], - 'imdb' => $show['imdb'], - 'tmdb' => $show['tmdb'], - ]); + 'type' => $show['type'], + 'title' => $show['title'], + 'countries_id' => $show['country'] ?? '', + 'started' => $show['started'], + 'source' => $show['source'], + 'tvdb' => $show['tvdb'], + 'trakt' => $show['trakt'], + 'tvrage' => $show['tvrage'], + 'tvmaze' => $show['tvmaze'], + 'imdb' => $show['imdb'], + 'tmdb' => $show['tmdb'], + ]); // Insert the supplementary show info TvInfo::query()->insert([ - 'videos_id' => $videoId, - 'summary' => $show['summary'], - 'publisher' => $show['publisher'], - 'localzone' => $show['localzone'], - ]); + 'videos_id' => $videoId, + 'summary' => $show['summary'], + 'publisher' => $show['publisher'], + 'localzone' => $show['localzone'], + ]); // If we have AKAs\aliases, insert those as well if (! empty($show['aliases'])) { $this->addAliases($videoId, $show['aliases']); diff --git a/Blacklight/processing/tv/TraktTv.php b/Blacklight/processing/tv/TraktTv.php index 7d459eee1..4e6db1e03 100755 --- a/Blacklight/processing/tv/TraktTv.php +++ b/Blacklight/processing/tv/TraktTv.php @@ -56,10 +56,10 @@ class TraktTv extends TV parent::__construct($options); $clientId = Settings::settingValue('APIs..trakttvclientkey'); $requestHeaders = [ - 'Content-Type' => 'application/json', - 'trakt-api-version' => 2, - 'trakt-api-key' => $clientId, - 'Content-Length' => 0, + 'Content-Type' => 'application/json', + 'trakt-api-version' => 2, + 'trakt-api-key' => $clientId, + 'Content-Length' => 0, ]; $this->client = new TraktAPI($requestHeaders); } @@ -331,21 +331,21 @@ class TraktTv extends TV $this->localizedTZ = $show['airs']['timezone']; return [ - 'type' => parent::TYPE_TV, - 'title' => (string) $show['title'], - 'summary' => (string) $show['overview'], - 'started' => Time::localizeAirdate($show['first_aired'], $this->localizedTZ), - 'publisher' => (string) $show['network'], - 'country' => (string) $show['country'], - 'source' => parent::SOURCE_TRAKT, - 'imdb' => $imdb['imdbid'] ?? 0, - 'tvdb' => $show['ids']['tvdb'] ?? 0, - 'trakt' => (int) $show['ids']['trakt'], - 'tvrage' => $show['ids']['tvrage'] ?? 0, - 'tvmaze' => 0, - 'tmdb' => $show['ids']['tmdb'] ?? 0, - 'aliases' => isset($show['aliases']) && ! empty($show['aliases']) ? (array) $show['aliases'] : '', - 'localzone' => $this->localizedTZ, + 'type' => parent::TYPE_TV, + 'title' => (string) $show['title'], + 'summary' => (string) $show['overview'], + 'started' => Time::localizeAirdate($show['first_aired'], $this->localizedTZ), + 'publisher' => (string) $show['network'], + 'country' => (string) $show['country'], + 'source' => parent::SOURCE_TRAKT, + 'imdb' => $imdb['imdbid'] ?? 0, + 'tvdb' => $show['ids']['tvdb'] ?? 0, + 'trakt' => (int) $show['ids']['trakt'], + 'tvrage' => $show['ids']['tvrage'] ?? 0, + 'tvmaze' => 0, + 'tmdb' => $show['ids']['tmdb'] ?? 0, + 'aliases' => isset($show['aliases']) && ! empty($show['aliases']) ? (array) $show['aliases'] : '', + 'localzone' => $this->localizedTZ, ]; } @@ -360,12 +360,12 @@ class TraktTv extends TV public function formatEpisodeInfo($episode): array { return [ - 'title' => (string) $episode['title'], - 'series' => (int) $episode['season'], - 'episode' => (int) $episode['epsiode'], - 'se_complete' => 'S'.sprintf('%02d', $episode['season']).'E'.sprintf('%02d', $episode['episode']), - 'firstaired' => Time::localizeAirdate($episode['first_aired'], $this->localizedTZ), - 'summary' => (string) $episode['overview'], + 'title' => (string) $episode['title'], + 'series' => (int) $episode['season'], + 'episode' => (int) $episode['epsiode'], + 'se_complete' => 'S'.sprintf('%02d', $episode['season']).'E'.sprintf('%02d', $episode['episode']), + 'firstaired' => Time::localizeAirdate($episode['first_aired'], $this->localizedTZ), + 'summary' => (string) $episode['overview'], ]; } } diff --git a/app/Console/Commands/FixturesUp.php b/app/Console/Commands/FixturesUp.php index 084b22279..a795c437b 100644 --- a/app/Console/Commands/FixturesUp.php +++ b/app/Console/Commands/FixturesUp.php @@ -11,15 +11,15 @@ class FixturesUp extends Command * @var array */ private static $allowedTables = [ - 'binaryblacklist', - 'root_categories', - 'categories', - 'category_regexes', - 'collection_regexes', - 'content', - 'usenet_groups', - 'release_naming_regexes', - 'settings', + 'binaryblacklist', + 'root_categories', + 'categories', + 'category_regexes', + 'collection_regexes', + 'content', + 'usenet_groups', + 'release_naming_regexes', + 'settings', ]; /** * The name and signature of the console command. diff --git a/app/Console/Commands/NntmuxResetDb.php b/app/Console/Commands/NntmuxResetDb.php index 148a60722..4de580da4 100644 --- a/app/Console/Commands/NntmuxResetDb.php +++ b/app/Console/Commands/NntmuxResetDb.php @@ -96,9 +96,9 @@ class NntmuxResetDb extends Command 'body' => [ 'settings' => [ 'number_of_shards' => 2, - 'number_of_replicas' => 0 - ] - ] + 'number_of_replicas' => 0, + ], + ], ]; Elasticsearch::indices()->create($releases_index); @@ -111,9 +111,9 @@ class NntmuxResetDb extends Command 'body' => [ 'settings' => [ 'number_of_shards' => 2, - 'number_of_replicas' => 0 - ] - ] + 'number_of_replicas' => 0, + ], + ], ]; Elasticsearch::indices()->create($predb_index); diff --git a/app/Extensions/util/Git.php b/app/Extensions/util/Git.php index b7da84af8..7aed8e05e 100644 --- a/app/Extensions/util/Git.php +++ b/app/Extensions/util/Git.php @@ -55,12 +55,12 @@ class Git $defaults = [ 'branches' => [ 'stable' => [ - 'master', - '\d+\.\d+\.\d+(\.\d+)?', - ], + 'master', + '\d+\.\d+\.\d+(\.\d+)?', + ], 'development' => [ - 'dev', - ], + 'dev', + ], ], 'filepath' => NN_ROOT, ]; diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index bf982fe23..bd85c6807 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -183,7 +183,7 @@ class RegisterController extends Controller return $this->registered($request, $user) ?: redirect($this->redirectPath())->with('info', 'Your Account has been created. You will receive a separate verification email shortly.'); } break; - case 'view': { + case 'view': // See if it is a valid invite. if (($inviteCode !== null) && ! Invite::isValid($inviteCode)) { $error = 'Invalid invitation token!'; @@ -192,7 +192,7 @@ class RegisterController extends Controller $showRegister = 1; } break; - } + } app('smarty.view')->assign( [ diff --git a/app/Models/Predb.php b/app/Models/Predb.php index 07b3a98cd..b93454609 100644 --- a/app/Models/Predb.php +++ b/app/Models/Predb.php @@ -196,8 +196,8 @@ class Predb extends Model 'body' => [ 'query' => [ 'match' =>['title' => $search], - ] - ] + ], + ], ]; $results = \Elasticsearch::search($search); @@ -205,7 +205,6 @@ class Predb extends Model $ids = []; foreach ($results['hits']['hits'] as $result) { $ids[] = $result['_source']['id']; - } } else { $sphinx = new SphinxSearch(); diff --git a/app/Models/ReleaseFile.php b/app/Models/ReleaseFile.php index 18f28be40..9582629e2 100644 --- a/app/Models/ReleaseFile.php +++ b/app/Models/ReleaseFile.php @@ -117,14 +117,14 @@ class ReleaseFile extends Model if ($duplicateCheck === null && $releaseCheck !== null) { try { $insert = self::insertOrIgnore([ - 'releases_id' => $id, - 'name' => $name, - 'size' => $size, - 'created_at' => $adjustedCreatedTime, - 'updated_at' => now()->timestamp, - 'passworded' => $hasPassword, - 'crc32' => $crc, - ]); + 'releases_id' => $id, + 'name' => $name, + 'size' => $size, + 'created_at' => $adjustedCreatedTime, + 'updated_at' => now()->timestamp, + 'passworded' => $hasPassword, + 'crc32' => $crc, + ]); } catch (\PDOException $e) { Log::alert($e->getMessage()); } diff --git a/app/Models/UsenetGroup.php b/app/Models/UsenetGroup.php index 642ef57b3..1b2c8f954 100644 --- a/app/Models/UsenetGroup.php +++ b/app/Models/UsenetGroup.php @@ -309,16 +309,16 @@ class UsenetGroup extends Model $checkOld = UsenetGroup::query()->where('name', trim($group['name']))->first(); if (empty($checkOld)) { return self::query()->insertGetId([ - 'name' => trim($group['name']), - 'description' => isset($group['description']) ? trim($group['description']) : '', - 'backfill_target' => $group['backfill_target'] ?? 1, - 'first_record' => $group['first_record'] ?? 0, - 'last_record' => $group['last_record'] ?? 0, - 'active' => $group['active'] ?? 0, - 'backfill' => $group['backfill'] ?? 0, - 'minsizetoformrelease' => $group['minsizetoformrelease'] ?? null, - 'minfilestoformrelease' => $group['minfilestoformrelease'] ?? null, - ]); + 'name' => trim($group['name']), + 'description' => isset($group['description']) ? trim($group['description']) : '', + 'backfill_target' => $group['backfill_target'] ?? 1, + 'first_record' => $group['first_record'] ?? 0, + 'last_record' => $group['last_record'] ?? 0, + 'active' => $group['active'] ?? 0, + 'backfill' => $group['backfill'] ?? 0, + 'minsizetoformrelease' => $group['minsizetoformrelease'] ?? null, + 'minfilestoformrelease' => $group['minfilestoformrelease'] ?? null, + ]); } return $checkOld->id; @@ -420,9 +420,9 @@ class UsenetGroup extends Model foreach ($res as $row) { $releases->deleteSingle( [ - 'g' => $row['guid'], - 'i' => $row['id'], - ], + 'g' => $row['guid'], + 'i' => $row['id'], + ], $nzb, $releaseImage ); diff --git a/app/Transformers/TagsTransformer.php b/app/Transformers/TagsTransformer.php index eda205301..42f15c27d 100644 --- a/app/Transformers/TagsTransformer.php +++ b/app/Transformers/TagsTransformer.php @@ -18,7 +18,7 @@ class TagsTransformer extends TransformerAbstract 'name' => [ 'normal' => $tagged->name, 'slug' => $tagged->slug, - ], + ], ]; } } diff --git a/config/fixtures.php b/config/fixtures.php index b28879c7d..b3fe4ca0b 100644 --- a/config/fixtures.php +++ b/config/fixtures.php @@ -20,5 +20,5 @@ return [ | The size of each insert chunk columns x rows <= $chunk_size. | */ - 'chunk_size' => 500, + 'chunk_size' => 500, ]; diff --git a/config/ide-helper.php b/config/ide-helper.php index 9d0992cb5..d27b0b9fd 100644 --- a/config/ide-helper.php +++ b/config/ide-helper.php @@ -173,8 +173,8 @@ return [ | Cast the given "real type" to the given "type". | */ - 'type_overrides' => [ + 'type_overrides' => [ 'integer' => 'int', 'boolean' => 'bool', - ], + ], ]; diff --git a/config/irc_settings.php b/config/irc_settings.php index e475bc46b..d7eec3c2b 100644 --- a/config/irc_settings.php +++ b/config/irc_settings.php @@ -9,56 +9,56 @@ return [ **********************************************************************************************************************/ 'username' => env('SCRAPE_IRC_USERNAME', ''), -/*********************************************************************************************************************** + /*********************************************************************************************************************** * The IRC server to connect to. * @note If you have issues connecting=>head to https://www.synirc.net/servers and try another server. **********************************************************************************************************************/ -'scrape_irc_server' => env('SCRAPE_IRC_SERVER', 'irc.synirc.net'), + 'scrape_irc_server' => env('SCRAPE_IRC_SERVER', 'irc.synirc.net'), -/*********************************************************************************************************************** + /*********************************************************************************************************************** * This is the port to the IRC server. * @note If you want use SSL/TLS=>use a corresponding port (6697 or 7001 for example)=>and set SCRAPE_IRC_TLS to true. **********************************************************************************************************************/ -'scrape_irc_port' => env('SCRAPE_IRC_PORT', 6667), + 'scrape_irc_port' => env('SCRAPE_IRC_PORT', 6667), -/*********************************************************************************************************************** + /*********************************************************************************************************************** * If you want to use SSL/TLS encryption on the IRC server=>set this to true. * @note Make sure you use a valid SSL/TLS port in SCRAPE_IRC_PORT. **********************************************************************************************************************/ -'scrape_irc_tls' => env('SCRAPE_IRC_TLS', false), + 'scrape_irc_tls' => env('SCRAPE_IRC_TLS', false), -/*********************************************************************************************************************** + /*********************************************************************************************************************** * This is the nick name visible in IRC channels. **********************************************************************************************************************/ -'scrape_irc_nickname'=> env('SCRAPE_IRC_USERNAME', ''), + 'scrape_irc_nickname'=> env('SCRAPE_IRC_USERNAME', ''), -/*********************************************************************************************************************** + /*********************************************************************************************************************** * This is a name that is visible to others when they type /whois nickname. **********************************************************************************************************************/ -'scrape_irc_realname'=> env('SCRAPE_IRC_USERNAME', ''), + 'scrape_irc_realname'=> env('SCRAPE_IRC_USERNAME', ''), -/*********************************************************************************************************************** + /*********************************************************************************************************************** * This is used as part of your "ident" when connecting to IRC. * @note This is also the username for ZNC. **********************************************************************************************************************/ -'scrape_irc_username' => env('SCRAPE_IRC_USERNAME', ''), + 'scrape_irc_username' => env('SCRAPE_IRC_USERNAME', ''), -/*********************************************************************************************************************** + /*********************************************************************************************************************** * This is not required by synirc=>but if you use ZNC=>this is required. * @note Put your password between quotes: 'mypassword' * @note If you are using ZNC and having issues=>try 'username:password' or 'username/network:' **********************************************************************************************************************/ -'scrape_irc_password' => env('SCRAPE_IRC_PASSWORD', false), + 'scrape_irc_password' => env('SCRAPE_IRC_PASSWORD', false), -/*********************************************************************************************************************** + /*********************************************************************************************************************** * This is an optional field you can use for ignoring categories. * @note If you do not wish to exclude any categories=>leave it a empty string: '' * @examples Case sensitive: '/^(XXX|PDA|EBOOK|MP3)$/' * Case insensitive: '/^(X264|TV)$/i' **********************************************************************************************************************/ -'scrape_irc_category_ignore' => '', + 'scrape_irc_category_ignore' => '', -/*********************************************************************************************************************** + /*********************************************************************************************************************** * This is an optional field you can use for ignoring PRE titles. * @note If you do not wish to exclude any PRE titles=>leave it a empty string: '' * @examples Case insensitive ignore German or XXX in the title: '/\.(German|XXX)\./i' @@ -66,9 +66,9 @@ return [ * Yanks.14.06.30.Bianca.Travelman.Is.A.Nudist.XXX.MP4-FUNKY * Blancanieves.Ein.Maerchen.von.Schwarz.und.Weiss.2012.German.1080p.BluRay.x264-CONTRiBUTiON **********************************************************************************************************************/ -'scrape_irc_title_ignore' => '', + 'scrape_irc_title_ignore' => '', -/*********************************************************************************************************************** + /*********************************************************************************************************************** * This is a list of all the channels we fetch PRE's from. **********************************************************************************************************************/ @@ -80,7 +80,7 @@ return [ ] ), -/*********************************************************************************************************************** + /*********************************************************************************************************************** * This is a list of all the sources we fetch PRE's from. * If you want to ignore a source=>change it from false to true. **********************************************************************************************************************/ diff --git a/config/nntmux_nntp.php b/config/nntmux_nntp.php index 9b5d844aa..d15e7b059 100644 --- a/config/nntmux_nntp.php +++ b/config/nntmux_nntp.php @@ -1,16 +1,16 @@ env('NNTP_SERVER', ''), - 'alternate_server' => env('NNTP_SERVER_A', ''), - 'port' => env('NNTP_PORT', ''), - 'alternate_server_port' => env('NNTP_PORT_A', ''), - 'username' => env('NNTP_USERNAME', ''), - 'alternate_server_username' => env('NNTP_USERNAME_A', ''), - 'password' => env('NNTP_PASSWORD', ''), - 'alternate_server_password' => env('NNTP_PASSWORD_A', ''), - 'ssl' => env('NNTP_SSLENABLED', false), - 'alternate_server_ssl' => env('NNTP_SSLENABLED_A', false), - 'socket_timeout' => env('NNTP_SOCKET_TIMEOUT', 120), - 'alternate_server_socket_timeout' => env('NNTP_SOCKET_TIMEOUT_A', 120), + 'server' => env('NNTP_SERVER', ''), + 'alternate_server' => env('NNTP_SERVER_A', ''), + 'port' => env('NNTP_PORT', ''), + 'alternate_server_port' => env('NNTP_PORT_A', ''), + 'username' => env('NNTP_USERNAME', ''), + 'alternate_server_username' => env('NNTP_USERNAME_A', ''), + 'password' => env('NNTP_PASSWORD', ''), + 'alternate_server_password' => env('NNTP_PASSWORD_A', ''), + 'ssl' => env('NNTP_SSLENABLED', false), + 'alternate_server_ssl' => env('NNTP_SSLENABLED_A', false), + 'socket_timeout' => env('NNTP_SOCKET_TIMEOUT', 120), + 'alternate_server_socket_timeout' => env('NNTP_SOCKET_TIMEOUT_A', 120), ]; diff --git a/config/services.php b/config/services.php index e34334cc9..614a47758 100644 --- a/config/services.php +++ b/config/services.php @@ -47,6 +47,6 @@ return [ 'igdb' => [ 'key' => env('IGDB_KEY', ''), 'url' => 'https://api-v3.igdb.com', -], + ], ]; diff --git a/config/sphinxsearch.php b/config/sphinxsearch.php index 1696cef0f..31ec9837a 100644 --- a/config/sphinxsearch.php +++ b/config/sphinxsearch.php @@ -6,5 +6,5 @@ return [ 'indexes' => [ 'releases' => 'releases_rt', 'predb' => 'predb_rt', - ], + ], ]; diff --git a/config/tagging.php b/config/tagging.php index ca892fad0..afaee444c 100644 --- a/config/tagging.php +++ b/config/tagging.php @@ -12,7 +12,7 @@ return [ 'displayer' => '\Illuminate\Support\Str::title', // Database connection for Conner\Taggable\Tag model to use -// 'connection' => 'mysql', + // 'connection' => 'mysql', // When deleting a model, remove all the tags first 'untag_on_delete' => true, diff --git a/config/ytake-laravel-smarty.php b/config/ytake-laravel-smarty.php index 4209a32b8..a071abcac 100644 --- a/config/ytake-laravel-smarty.php +++ b/config/ytake-laravel-smarty.php @@ -95,99 +95,99 @@ return [ * See smarty docs for usage */ -// 'auto_literal' => null, -// 'error_unassigned' => null, -// 'use_include_path' => null, -// 'joined_template_dir' => null, -// 'joined_config_dir' => null, -// 'default_template_handler_func' => null, -// 'default_config_handler_func' => null, -// 'default_plugin_handler_func' => null, -// 'use_sub_dirs' => null, -// 'allow_ambiguous_resources' => null, -// 'merge_compiled_includes' => null, -// 'inheritance_merge_compiled_includes' => null, -// 'force_cache' => null, -// 'security_class' => null, -// 'php_handling' => null, -// 'allow_php_templates' => null, -// 'direct_access_security' => null, -// 'debugging_ctrl' => null, -// 'smarty_debug_id' => null, -// 'debug_tpl' => null, -// 'error_reporting' => null, -// 'get_used_tags' => null, -// 'config_overwrite' => null, -// 'config_booleanize' => null, -// 'config_read_hidden' => null, -// 'compile_locking' => null, -// 'cache_locking' => null, -// 'locking_timeout' => null, -// 'default_resource_type' => null, -// 'caching_type' => null, -// 'properties' => null, -// 'default_config_type' => null, -// 'source_objects' => null, -// 'template_objects' => null, -// 'resource_caching' => null, -// 'template_resource_caching' => null, -// 'cache_modified_check' => null, -// 'registered_plugins' => null, -// 'plugin_search_order' => null, -// 'registered_objects' => null, -// 'registered_classes' => null, -// 'registered_filters' => null, -// 'registered_resources' => null, -// '_resource_handlers' => null, -// 'registered_cache_resources' => null, -// '_cacheresource_handlers' => null, -// 'autoload_filters' => null, -// 'default_modifiers' => null, -// 'escape_html' => null, -// 'start_time' => null, -// '_file_perms' => null, -// '_dir_perms' => null, -// '_tag_stack' => null, -// '_current_file' => null, -// '_parserdebug' => null, -// '_is_file_cache' => null, -// 'cache_id' => null, -// 'compile_id' => null, -// 'template_class' => null, -// 'tpl_vars' => null, -// 'parent' => null, -// 'config_vars' => null, + // 'auto_literal' => null, + // 'error_unassigned' => null, + // 'use_include_path' => null, + // 'joined_template_dir' => null, + // 'joined_config_dir' => null, + // 'default_template_handler_func' => null, + // 'default_config_handler_func' => null, + // 'default_plugin_handler_func' => null, + // 'use_sub_dirs' => null, + // 'allow_ambiguous_resources' => null, + // 'merge_compiled_includes' => null, + // 'inheritance_merge_compiled_includes' => null, + // 'force_cache' => null, + // 'security_class' => null, + // 'php_handling' => null, + // 'allow_php_templates' => null, + // 'direct_access_security' => null, + // 'debugging_ctrl' => null, + // 'smarty_debug_id' => null, + // 'debug_tpl' => null, + // 'error_reporting' => null, + // 'get_used_tags' => null, + // 'config_overwrite' => null, + // 'config_booleanize' => null, + // 'config_read_hidden' => null, + // 'compile_locking' => null, + // 'cache_locking' => null, + // 'locking_timeout' => null, + // 'default_resource_type' => null, + // 'caching_type' => null, + // 'properties' => null, + // 'default_config_type' => null, + // 'source_objects' => null, + // 'template_objects' => null, + // 'resource_caching' => null, + // 'template_resource_caching' => null, + // 'cache_modified_check' => null, + // 'registered_plugins' => null, + // 'plugin_search_order' => null, + // 'registered_objects' => null, + // 'registered_classes' => null, + // 'registered_filters' => null, + // 'registered_resources' => null, + // '_resource_handlers' => null, + // 'registered_cache_resources' => null, + // '_cacheresource_handlers' => null, + // 'autoload_filters' => null, + // 'default_modifiers' => null, + // 'escape_html' => null, + // 'start_time' => null, + // '_file_perms' => null, + // '_dir_perms' => null, + // '_tag_stack' => null, + // '_current_file' => null, + // '_parserdebug' => null, + // '_is_file_cache' => null, + // 'cache_id' => null, + // 'compile_id' => null, + // 'template_class' => null, + // 'tpl_vars' => null, + // 'parent' => null, + // 'config_vars' => null, /* * If true smarty will enable security `$smarty->enableSecurity()` */ -// 'enable_security' => false, + // 'enable_security' => false, /* * The following settings will be applied to the smarty security policy object `$smarty->security_policy` * Ignored if enable_security == false */ -// 'security_policy' => [ -// 'php_handling' => null, -// 'secure_dir' => null, -// 'trusted_dir' => null, -// 'trusted_uri' => null, -// 'trusted_constants' => null, -// 'static_classes' => null, -// 'trusted_static_methods' => null, -// 'trusted_static_properties' => null, -// 'php_functions' => null, -// 'php_modifiers' => null, -// 'allowed_tags' => null, -// 'disabled_tags' => null, -// 'allowed_modifiers' => null, -// 'disabled_modifiers' => null, -// 'disabled_special_smarty_vars' => null, -// 'streams' => null, -// 'allow_constants' => null, -// 'allow_super_globals' => null, -// 'max_template_nesting' => null, -// ] + // 'security_policy' => [ + // 'php_handling' => null, + // 'secure_dir' => null, + // 'trusted_dir' => null, + // 'trusted_uri' => null, + // 'trusted_constants' => null, + // 'static_classes' => null, + // 'trusted_static_methods' => null, + // 'trusted_static_properties' => null, + // 'php_functions' => null, + // 'php_modifiers' => null, + // 'allowed_tags' => null, + // 'disabled_tags' => null, + // 'allowed_modifiers' => null, + // 'disabled_modifiers' => null, + // 'disabled_special_smarty_vars' => null, + // 'streams' => null, + // 'allow_constants' => null, + // 'allow_super_globals' => null, + // 'max_template_nesting' => null, + // ] ]; diff --git a/misc/elasticsearch/create_es_indexes.php b/misc/elasticsearch/create_es_indexes.php index 474588dfa..1b59f22ec 100644 --- a/misc/elasticsearch/create_es_indexes.php +++ b/misc/elasticsearch/create_es_indexes.php @@ -1,7 +1,5 @@ exists(['index' => 'releases'])) { @@ -12,9 +10,9 @@ $releases_index = [ 'body' => [ 'settings' => [ 'number_of_shards' => 2, - 'number_of_replicas' => 0 - ] - ] + 'number_of_replicas' => 0, + ], + ], ]; $response = Elasticsearch::indices()->create($releases_index); @@ -28,14 +26,13 @@ $predb_index = [ 'body' => [ 'settings' => [ 'number_of_shards' => 2, - 'number_of_replicas' => 0 - ] - ] + 'number_of_replicas' => 0, + ], + ], ]; $response = Elasticsearch::indices()->create($predb_index); print_r($response); - echo 'All done! ElasticSearch indexes are created now.'.PHP_EOL; diff --git a/misc/manticoresearch/populate_rt_indexes.php b/misc/manticoresearch/populate_rt_indexes.php index c13a30955..8d3a87f08 100644 --- a/misc/manticoresearch/populate_rt_indexes.php +++ b/misc/manticoresearch/populate_rt_indexes.php @@ -78,21 +78,21 @@ function populate_rt($table, $max) switch ($table) { case 'releases_rt': $sphinx->insertRelease([ - 'id' => $row->id, - 'name' => $row->name, - 'searchname' => $row->searchname, - 'fromname' => $row->fromname, - 'filename' => $row->filename, - ]); + 'id' => $row->id, + 'name' => $row->name, + 'searchname' => $row->searchname, + 'fromname' => $row->fromname, + 'filename' => $row->filename, + ]); break; case 'predb_rt': $sphinx->insertPredb([ - 'id' => $row->id, - 'title' => $row->title, - 'filename' => $row->filename, - 'source' => $row->source, - ]); + 'id' => $row->id, + 'title' => $row->title, + 'filename' => $row->filename, + 'source' => $row->source, + ]); break; } } diff --git a/misc/update/tmux/bin/update_groups.php b/misc/update/tmux/bin/update_groups.php index c9db22ba1..4e2578aa1 100644 --- a/misc/update/tmux/bin/update_groups.php +++ b/misc/update/tmux/bin/update_groups.php @@ -38,11 +38,11 @@ $result = Arr::pluck(UsenetGroup::query()->where('active', '=', 1)->orWhere('bac foreach ($data as $newgroup) { if (\in_array($newgroup['group'], $result, false)) { ShortGroup::query()->insert([ - 'name' => $newgroup['group'], - 'first_record' => $newgroup['first'], - 'last_record' => $newgroup['last'], - 'updated' => now(), - ]); + 'name' => $newgroup['group'], + 'first_record' => $newgroup['first'], + 'last_record' => $newgroup['last'], + 'updated' => now(), + ]); $colorCli->primary('Updated '.$newgroup['group']); } }