@@ -57,17 +57,21 @@ public QueryFeature()
5757 /// <inheritdoc/>
5858 public override bool Execute ( )
5959 {
60- // Get values needed more than once
61- bool onlyList = ListInput . Value ;
62- string ? outputDirectory = OutputInput . Value ;
63- string ? queryString = QueryInput . Value ;
60+ // Get common values
61+ string ? outDir = OutputInput . Value ;
62+ string username = UsernameInput . Value ?? string . Empty ;
63+ string password = PasswordInput . Value ?? string . Empty ;
6464 int ? attemptCount = AttemptCountInput . Value ;
6565 int ? timeout = TimeoutInput . Value ;
66+
67+ // Get specific values
68+ bool onlyList = ListInput . Value ;
69+ string ? queryString = QueryInput . Value ;
6670 bool quick = QuickSearchInput . Value ;
6771 bool convertForwardSlashes = ! NoSlashInput . Value ;
6872
6973 // Output directory validation
70- if ( ! onlyList && ! ValidateAndCreateOutputDirectory ( outputDirectory ) )
74+ if ( ! onlyList && ! ValidateAndCreateOutputDirectory ( outDir ) )
7175 return false ;
7276
7377 // Query verification (and cleanup)
@@ -79,7 +83,7 @@ public override bool Execute()
7983
8084 // Login to Redump, if necessary
8185 if ( ! _client . LoggedIn )
82- _client . Login ( UsernameInput . Value ?? string . Empty , PasswordInput . Value ?? string . Empty ) . Wait ( ) ;
86+ _client . Login ( username , password ) . Wait ( ) ;
8387
8488 // Update client properties
8589 _client . Debug = DebugInput . Value ;
@@ -95,14 +99,14 @@ public override bool Execute()
9599 if ( onlyList )
96100 processingTask = _client . ListSearchResults ( queryString , convertForwardSlashes ) ;
97101 else
98- processingTask = _client . DownloadSearchResults ( queryString , outputDirectory , convertForwardSlashes ) ;
102+ processingTask = _client . DownloadSearchResults ( queryString , outDir , convertForwardSlashes ) ;
99103 }
100104 else
101105 {
102106 if ( onlyList )
103107 processingTask = _client . ListDiscsResults ( queryString , convertForwardSlashes ) ;
104108 else
105- processingTask = _client . DownloadDiscsResults ( queryString , outputDirectory , convertForwardSlashes ) ;
109+ processingTask = _client . DownloadDiscsResults ( queryString , outDir , convertForwardSlashes ) ;
106110 }
107111
108112 // Retrieve the result
0 commit comments