diff --git a/composer.json b/composer.json index 1767b9d..a6f5475 100644 --- a/composer.json +++ b/composer.json @@ -23,9 +23,9 @@ "ext-json": "*", "ext-iconv": "*", "ext-xmlrpc": "*", - "symfony/console": "3.4.* || 5.0.*", - "symfony/finder": "3.4.* || 5.0.*", - "symfony/stopwatch": "3.4.* || 5.0.*" + "symfony/console": "3.4.* || 5.1.*", + "symfony/finder": "3.4.* || 5.1.*", + "symfony/stopwatch": "3.4.* || 5.1.*" }, "config": { }, diff --git a/src/Cleaner.php b/src/Cleaner.php index ba917cf..a73dad4 100644 --- a/src/Cleaner.php +++ b/src/Cleaner.php @@ -31,9 +31,12 @@ protected function getFileListFromRtorrent() $torrents = $this->rtorrent->call('d.multicall2', ['', 'default', 'd.hash=', 'd.name=', 'd.directory=']); $this->numTorrents = count($torrents); $this->missingFileData = []; + $this->rtorrentFileData = []; if ($this->numTorrents === 0) { - throw new \Exception('No torrent found in rtorrent.'); + $this->directories[] = $this->rtorrent->call('directory.default'); + + return $this; } $progressBar = new ProgressBar($this->output, $this->numTorrents); diff --git a/src/Command/DebugCommand.php b/src/Command/DebugCommand.php index a9264cc..e80e149 100644 --- a/src/Command/DebugCommand.php +++ b/src/Command/DebugCommand.php @@ -62,7 +62,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $table->render(); } - $date = (new \DateTime())->format('D, j M Y H:i:s'); + $date = (new \DateTime())->format('d/m/Y H:i:s'); $event = $time->stop(); $time = Helpers::humanTime($event->getDuration()); $output->writeln(['', '> time: '.$time.', date: '.$date]); diff --git a/src/Command/MoveCommand.php b/src/Command/MoveCommand.php index 6b53687..94546e6 100644 --- a/src/Command/MoveCommand.php +++ b/src/Command/MoveCommand.php @@ -113,12 +113,12 @@ protected function execute(InputInterface $input, OutputInterface $output) } } - $date = (new \DateTime())->format('D, j M Y H:i:s'); + $date = (new \DateTime())->format('d/m/Y H:i:s'); $torrents = $cleaner->getnumTorrents(); $space = Helpers::convertFileSize($cleaner->getFreeDiskSpace(), 2); $event = $time->stop(); $time = Helpers::humanTime($event->getDuration()); - $console->writeln(['', '> time: '.$time.', torrents: '.$torrents.', free space: '.$space.', date: '.$date]); + $console->writeln(['', '> time: '.$time.', torrents: '.$torrents.', free: '.$space.', date: '.$date]); return 0; } diff --git a/src/Command/RemoveCommand.php b/src/Command/RemoveCommand.php index b46bdb3..10b2271 100644 --- a/src/Command/RemoveCommand.php +++ b/src/Command/RemoveCommand.php @@ -115,12 +115,12 @@ protected function execute(InputInterface $input, OutputInterface $output) } } - $date = (new \DateTime())->format('D, j M Y H:i:s'); + $date = (new \DateTime())->format('d/m/Y H:i:s'); $torrents = $cleaner->getnumTorrents(); $space = Helpers::convertFileSize($cleaner->getFreeDiskSpace(), 2); $event = $time->stop(); $time = Helpers::humanTime($event->getDuration()); - $console->writeln(['', '> time: '.$time.', torrents: '.$torrents.', free space: '.$space.', date: '.$date]); + $console->writeln(['', '> time: '.$time.', torrents: '.$torrents.', free: '.$space.', date: '.$date]); return 0; } diff --git a/src/Command/ReportCommand.php b/src/Command/ReportCommand.php index 12e6e08..01e2a17 100644 --- a/src/Command/ReportCommand.php +++ b/src/Command/ReportCommand.php @@ -116,12 +116,12 @@ protected function execute(InputInterface $input, OutputInterface $output) $console->writeln('> No missing files.'); } - $date = (new \DateTime())->format('D, j M Y H:i:s'); + $date = (new \DateTime())->format('d/m/Y H:i:s'); $torrents = $cleaner->getnumTorrents(); $space = Helpers::convertFileSize($cleaner->getFreeDiskSpace(), 2); $event = $time->stop(); $time = Helpers::humanTime($event->getDuration()); - $console->writeln(['', '> time: '.$time.', torrents: '.$torrents.', free space: '.$space.', date: '.$date]); + $console->writeln(['', '> time: '.$time.', torrents: '.$torrents.', free: '.$space.', date: '.$date]); return 0; } diff --git a/src/Command/TorrentsCommand.php b/src/Command/TorrentsCommand.php index fabb863..dd5d0e5 100644 --- a/src/Command/TorrentsCommand.php +++ b/src/Command/TorrentsCommand.php @@ -75,12 +75,12 @@ protected function execute(InputInterface $input, OutputInterface $output) } } - $date = (new \DateTime())->format('D, j M Y H:i:s'); + $date = (new \DateTime())->format('d/m/Y H:i:s'); $torrents = $cleaner->getnumTorrents(); $space = Helpers::convertFileSize($cleaner->getFreeDiskSpace(), 2); $event = $time->stop(); $time = Helpers::humanTime($event->getDuration()); - $output->writeln(['', '> time: '.$time.', torrents: '.$torrents.', free space: '.$space.', date: '.$date]); + $output->writeln(['', '> time: '.$time.', torrents: '.$torrents.', free: '.$space.', date: '.$date]); return 0; } diff --git a/src/Console/Application.php b/src/Console/Application.php index 9d95cf4..73f2b6a 100644 --- a/src/Console/Application.php +++ b/src/Console/Application.php @@ -14,7 +14,7 @@ class Application extends BaseApplication { - private $version = '0.9.7'; + private $version = '0.9.8'; private $name = 'rtorrent-cleaner'; public function __construct()