You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Command/DownloadCommand.php
+80-8Lines changed: 80 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -2,13 +2,16 @@
2
2
3
3
namespaceApp\Command;
4
4
5
+
useApp\DTO\DownloadDescription;
6
+
useApp\DTO\GameExtra;
5
7
useApp\Enum\Language;
6
8
useApp\Enum\NamingConvention;
7
9
useApp\Enum\Setting;
8
10
useApp\Exception\ExitException;
9
11
useApp\Exception\InvalidValueException;
10
12
useApp\Exception\TooManyRetriesException;
11
13
useApp\Exception\UnreadableFileException;
14
+
useApp\Helper\LatelyBoundStringValue;
12
15
useApp\Service\DownloadManager;
13
16
useApp\Service\FileWriter\FileWriterLocator;
14
17
useApp\Service\Iterables;
@@ -93,6 +96,27 @@ protected function configure()
93
96
mode: InputOption::VALUE_REQUIRED,
94
97
description: 'Specify the maximum download speed in bytes. You can use the k postfix for kilobytes or m postfix for megabytes (for example 200k or 4m to mean 200 kilobytes and 4 megabytes respectively)',
95
98
)
99
+
->addOption(
100
+
name: 'extras',
101
+
shortcut: 'e',
102
+
mode: InputOption::VALUE_NONE,
103
+
description: 'Whether to include extras or not.',
104
+
)
105
+
->addOption(
106
+
name: 'skip-existing-extras',
107
+
mode: InputOption::VALUE_NONE,
108
+
description: "Unlike games, extras generally don't have a hash that can be used to check whether the downloaded content is the same as the remote one, meaning by default extras will be downloaded every time, even if they exist. By providing this flag, you will skip existing extras."
109
+
)
110
+
->addOption(
111
+
name: 'no-games',
112
+
mode: InputOption::VALUE_NONE,
113
+
description: 'Skip downloading games. Should be used with other options like --extras if you want to only download those.'
$io->warning("{$download->name} ({$download->platform}, {$download->language}): Tried to get existing hash of {$download->name}, but the file is not readable. It will be downloaded again");
248
+
$io->warning("{$downloadTag}: Tried to get existing hash of {$download->name}, but the file is not readable. It will be downloaded again");
183
249
$md5 = '';
184
250
}
185
251
if (!$noVerify && $download->md5 === $md5) {
186
252
if ($output->isVerbose()) {
187
253
$io->writeln(
188
-
"{$download->name} ({$download->platform}, {$download->language}): Skipping because it exists and is valid",
254
+
"{$downloadTag}: Skipping because it exists and is valid",
$io->writeln("{$downloadTag}: Skipping because it exists (--skip-existing-extras specified, not checking content)");
262
+
}
263
+
192
264
return;
193
265
} elseif ($noVerify) {
194
266
if ($output->isVerbose()) {
195
-
$io->writeln("{$download->name} ({$download->platform}, {$download->language}): Skipping because it exists (--no-verify specified, not checking content)");
267
+
$io->writeln("{$downloadTag}: Skipping because it exists (--no-verify specified, not checking content)");
196
268
}
197
269
198
270
return;
@@ -202,7 +274,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
0 commit comments