Skip to content

Commit

Permalink
#50 resolved root issue witch was calling the ToLowerInvariant method…
Browse files Browse the repository at this point in the history
… on a null object.
  • Loading branch information
Rian-Porfirio committed Jul 4, 2024
1 parent 2338420 commit ff93d97
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Benny-Scraper/CommandlineOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ public class CommandLineOptions
[Option('c', "concurrent-request", Required = false, HelpText = "Set the number [INT] of concurrent requests to a website. Default is 2, value will be limited to number of CPU cores on your computer. *Some websites may block your ip if too many requests are made in a short time*")]
public int ConcurrentRequests { get; set; }

[Option('s', "save-location", Required = false, Default = "", HelpText = "Set default save location [PATH]. Overridden by specific 'manga' or 'novel' locations if set.")]
[Option('s', "save-location", Required = false, HelpText = "Set default save location [PATH]. Overridden by specific 'manga' or 'novel' locations if set.")]
public string SaveLocation { get; set; }

[Option('m', "manga-save-location", Required = false, Default = "", HelpText = "Set manga-specific save location [PATH]. Overrides 'save-location'.")]
[Option('m', "manga-save-location", Required = false, HelpText = "Set manga-specific save location [PATH]. Overrides 'save-location'.")]
public string MangaSaveLocation { get; set; }

[Option('n', "novel-save-location", Required = false, Default = "", HelpText = "Set novel-specific save location [PATH]. Overrides 'save-location'.")]
[Option('n', "novel-save-location", Required = false, HelpText = "Set novel-specific save location [PATH]. Overrides 'save-location'.")]
public string NovelSaveLocation { get; set; }

[Option('x', "novel-extension-by-id", Required = false, HelpText = "Set Extension/File type of a saved novel by using the [ID]. 0 - EPUB, 1 - PDF, 2 -CBZ.")]
Expand Down
6 changes: 3 additions & 3 deletions Benny-Scraper/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,17 +217,17 @@ private static async Task HandleOptionsAsync(CommandLineOptions options)
int extension = (int)options.MangaExtension;
await SetDefaultMangaExtensionAsync(extension);
}
else if (string.Equals(options.SingleFile.ToLowerInvariant(), "y", StringComparison.OrdinalIgnoreCase) || string.Equals(options.SingleFile.ToLowerInvariant(), "n", StringComparison.OrdinalIgnoreCase))
else if (string.Equals(options.SingleFile?.ToLowerInvariant(), "y", StringComparison.OrdinalIgnoreCase) || string.Equals(options.SingleFile?.ToLowerInvariant(), "n", StringComparison.OrdinalIgnoreCase))
{
bool singleFile = options.SingleFile.ToLowerInvariant() == "y";
bool singleFile = options.SingleFile?.ToLowerInvariant() == "y";
await SetSingleFileAsync(singleFile);
}
else if (options.ExtensionType)
{
await GetDefaultMangaExtensionAsync();
}
else
Console.WriteLine("Invalid command. Please try again.");
Console.WriteLine("Invalid command or a parameter is missing. Please try again.");
}

private static async Task UpdateAllNovelsAsync(CancellationToken cancellation)
Expand Down
1 change: 0 additions & 1 deletion Benny-Scraper/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
},
"Benny-Scraper": {
"commandName": "Project",
"commandLineArgs" : "-s",
"nativeDebugging": true
}
}
Expand Down

0 comments on commit ff93d97

Please sign in to comment.