@@ -16,7 +16,7 @@ class DownloadCommand extends Command
16
16
{
17
17
/** {@inheritdoc} */
18
18
protected $ signature = 'download { trakt-user? : Trakt username for the list }
19
- { list=watchlist : A custom list id or stub }
19
+ { list? : A custom list id or stub }
20
20
{ --o|output=./torrents : The directory to output data to }
21
21
{ --quality=1080p : The quality to download (720p, 1080p or 3D) }
22
22
{ --y|force : Do not prompt about downloading torrents } ' ;
@@ -37,12 +37,17 @@ public function handle(TraktClient $traktClient, YTSClient $ytsClient): void
37
37
$ this ->yts = $ ytsClient ;
38
38
39
39
$ quality = Quality::tryFrom ($ this ->option ('quality ' )) ?? Quality::Q_1080P ;
40
+ $ username = $ this ->argument ('trakt-user ' ) ?? $ this ->ask ('What is the Trakt username? ' );
41
+ $ list = $ this ->argument ('list ' ) ?? $ this ->ask ('What is the list slug or id? ' , 'watchlist ' );
42
+
43
+ if ($ username === null ) {
44
+ $ this ->components ->warn ('A Trakt user must be specified ' );
45
+
46
+ return ;
47
+ }
40
48
41
49
try {
42
- $ this ->retrieveTraktList (
43
- $ this ->argument ('trakt-user ' ) ?? $ this ->ask ('What is the Trakt username ' ),
44
- $ this ->argument ('list ' ) ?? $ this ->ask ('What is the list slug or id ' ),
45
- )->downloadTorrentsFromYts ($ quality );
50
+ $ this ->retrieveTraktList ($ username , $ list )->downloadTorrentsFromYts ($ quality );
46
51
} catch (\RuntimeException $ exception ) {
47
52
$ this ->warn ($ exception ->getMessage ());
48
53
0 commit comments