@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | return 1; |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - $blackTorrentList = array_filter($torrentList, function ($torrent) use ($blacklist) { |
|
| 40 | + $blackTorrentList = array_filter($torrentList, function($torrent) use ($blacklist) { |
|
| 41 | 41 | return in_array($torrent[Torrent\Get::NAME], $blacklist); |
| 42 | 42 | }); |
| 43 | 43 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | $client->printTorrentsTable($blackTorrentList, $output); |
| 49 | 49 | $output->writeln('Total size: ' . $sizeInGb . ' Gb'); |
| 50 | 50 | |
| 51 | - $this->dryRun($input, $output, function () use ($logger) { |
|
| 51 | + $this->dryRun($input, $output, function() use ($logger) { |
|
| 52 | 52 | $logger->critical('actual delete not implemented!'); |
| 53 | 53 | //$client->removeTorrents($blackTorrentList, true); |
| 54 | 54 | }, 'dry-run, don\'t really remove'); |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | $torrentsUrls = $this->getPopularTorrentsUrls($output, $weburgClient, $downloadDir); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - $this->dryRun($input, $output, function () use ($weburgClient, $torrentsDir, $torrentsUrls) { |
|
| 45 | + $this->dryRun($input, $output, function() use ($weburgClient, $torrentsDir, $torrentsUrls) { |
|
| 46 | 46 | foreach ($torrentsUrls as $torrentUrl) { |
| 47 | 47 | $weburgClient->downloadTorrent($torrentUrl, $torrentsDir); |
| 48 | 48 | } |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | return 0; |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - $this->dryRun($input, $output, function () use ($logger, $client, $obsoleteList) { |
|
| 35 | + $this->dryRun($input, $output, function() use ($logger, $client, $obsoleteList) { |
|
| 36 | 36 | $client->removeTorrents($obsoleteList); |
| 37 | 37 | $names = $client->getTorrentsField($obsoleteList, Torrent\Get::NAME); |
| 38 | 38 | $logger->info('Removed torrents:' . implode(', ', $names)); |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | $config->loadConfigFile(); |
| 59 | 59 | } catch (\RuntimeException $e) { |
| 60 | 60 | $logger->critical($e->getMessage()); |
| 61 | - $this->setCode(function () { |
|
| 61 | + $this->setCode(function() { |
|
| 62 | 62 | return 1; |
| 63 | 63 | }); |
| 64 | 64 | return; |
@@ -47,8 +47,8 @@ |
||
| 47 | 47 | ]; |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - $cleanedIds = array_map(function ($torrentId) { |
|
| 51 | - return (int)$torrentId; |
|
| 50 | + $cleanedIds = array_map(function($torrentId) { |
|
| 51 | + return (int) $torrentId; |
|
| 52 | 52 | }, $ids); |
| 53 | 53 | |
| 54 | 54 | $this->createSession(); |
@@ -13,8 +13,7 @@ |
||
| 13 | 13 | public static function getTorrentAge($torrent) |
| 14 | 14 | { |
| 15 | 15 | $date = isset($torrent[Torrent\Get::DONE_DATE]) && $torrent[Torrent\Get::DONE_DATE] ? |
| 16 | - $torrent[Torrent\Get::DONE_DATE] : |
|
| 17 | - (isset($torrent[Torrent\Get::ADDED_DATE]) ? $torrent[Torrent\Get::ADDED_DATE] : 0); |
|
| 16 | + $torrent[Torrent\Get::DONE_DATE] : (isset($torrent[Torrent\Get::ADDED_DATE]) ? $torrent[Torrent\Get::ADDED_DATE] : 0); |
|
| 18 | 17 | return $date ? time() - $date : 0; |
| 19 | 18 | } |
| 20 | 19 | |
@@ -111,6 +111,9 @@ |
||
| 111 | 111 | ); |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | + /** |
|
| 115 | + * @param string $transmissionHost |
|
| 116 | + */ |
|
| 114 | 117 | public function getLastPoint(array $torrent, $transmissionHost) |
| 115 | 118 | { |
| 116 | 119 | $this->connectDatabase(); |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - $this->dryRun($input, $output, function () use ($influxDbClient, $points, $logger) { |
|
| 73 | + $this->dryRun($input, $output, function() use ($influxDbClient, $points, $logger) { |
|
| 74 | 74 | $isSuccess = $influxDbClient->writePoints($points); |
| 75 | 75 | $logger->info('InfluxDB write ' . ($isSuccess ? 'success' : 'failed')); |
| 76 | 76 | }, 'dry-run, don\'t really send points'); |
@@ -46,8 +46,8 @@ |
||
| 46 | 46 | $config->get('influxdb-database') |
| 47 | 47 | ); |
| 48 | 48 | |
| 49 | - $lastDays = (int)$input->getOption('days') ? (int)$input->getOption('days') : 0; |
|
| 50 | - $limit = (int)$input->getOption('limit') ? (int)$input->getOption('limit') : 0; |
|
| 49 | + $lastDays = (int) $input->getOption('days') ? (int) $input->getOption('days') : 0; |
|
| 50 | + $limit = (int) $input->getOption('limit') ? (int) $input->getOption('limit') : 0; |
|
| 51 | 51 | |
| 52 | 52 | $torrentList = $client->getTorrentData(); |
| 53 | 53 | |