Hook up undocumented behavior, limit to site feature only

This commit is contained in:
Matt Nadareski
2026-03-02 16:00:32 -05:00
parent ef5b33d7b8
commit ff4da8e09a
4 changed files with 51 additions and 146 deletions

View File

@@ -2,7 +2,6 @@ using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using SabreTools.CommandLine.Inputs;
using SabreTools.RedumpLib.Data;
using SabreTools.RedumpLib.Web;
namespace RedumpTool.Features
@@ -53,32 +52,6 @@ namespace RedumpTool.Features
Add(ForceDownloadInput);
Add(ForceContinueInput);
// Discs Path
Add(AntiModchipInput);
Add(BarcodeInput);
Add(CategoryInput);
Add(CommentsInput);
Add(ContentsInput);
Add(DiscTypeInput);
Add(DumperInput);
Add(EdcInput);
Add(EditionInput);
Add(ErrorsInput);
Add(LanguageInput);
Add(LetterInput);
Add(LibCryptInput);
Add(MediaInput);
Add(OffsetInput);
Add(ProtectionInput);
Add(QuickSearchInput);
Add(RegionInput);
Add(RingcodeInput);
Add(SortInput);
Add(SortDirInput);
Add(StatusInput);
Add(SystemInput);
Add(TracksInput);
// Specific
Add(QueryInput);
Add(QuickQueryName);
@@ -99,47 +72,6 @@ namespace RedumpTool.Features
bool forceDownload = ForceDownloadInput.Value;
bool forceContinue = ForceContinueInput.Value;
// Get discs path values
bool? antiModchip = AntiModchipInput.Value;
bool barcode = BarcodeInput.Value;
string? categoryString = CategoryInput.Value;
DiscCategory? category = categoryString.ToDiscCategory();
bool comments = CommentsInput.Value;
bool contents = ContentsInput.Value;
string? discTypeString = DiscTypeInput.Value;
DiscType? discType = discTypeString.ToDiscType();
string? dumper = DumperInput.Value;
bool? edc = EdcInput.Value;
string? edition = EditionInput.Value;
string? errors = ErrorsInput.Value;
string? languageString = LanguageInput.Value;
Language? language = languageString.ToLanguage();
char? letter = string.IsNullOrEmpty(LetterInput.Value)
? null
: LetterInput.Value![0];
bool? libcrypt = LibCryptInput.Value;
MediaType? media = MediaInput.Value?.ToLowerInvariant() switch
{
"cd" => MediaType.CDROM,
"dvd" => MediaType.DVD,
_ => null,
};
int? offset = OffsetInput.Value;
bool protection = ProtectionInput.Value;
string? quicksearch = QuickSearchInput.Value;
string? regionString = RegionInput.Value;
Region? region = regionString.ToRegion();
string? ringcode = RingcodeInput.Value;
string? sortString = SortInput.Value;
SortCategory? sort = sortString.ToSortCategory();
string? sortDirString = SortDirInput.Value;
SortDirection? sortDir = sortDirString.ToSortDirection();
string? statusString = StatusInput.Value;
DumpStatus? status = statusString.ToDumpStatus();
string? systemString = SystemInput.Value;
RedumpSystem? system = systemString.ToRedumpSystem();
int? tracks = TracksInput.Value;
// Get specific values
bool onlyList = ListInput.Value;
string? queryString = QueryInput.Value;

View File

@@ -96,7 +96,7 @@ namespace RedumpTool.Features
bool forceContinue = ForceContinueInput.Value;
// Get discs path values
bool? antiModchip = AntiModchipInput.Value;
bool? antimodchip = AntiModchipInput.Value;
bool barcode = BarcodeInput.Value;
string? categoryString = CategoryInput.Value;
DiscCategory? category = categoryString.ToDiscCategory();
@@ -105,7 +105,8 @@ namespace RedumpTool.Features
string? discTypeString = DiscTypeInput.Value;
DiscType? discType = discTypeString.ToDiscType();
string? dumper = DumperInput.Value;
bool? edc = EdcInput.Value;
bool? edcBool = EdcInput.Value;
YesNo? edc = edcBool?.ToYesNo();
string? edition = EditionInput.Value;
string? errors = ErrorsInput.Value;
string? languageString = LanguageInput.Value;
@@ -146,13 +147,6 @@ namespace RedumpTool.Features
if (!ValidateAndCreateOutputDirectory(outDir))
return false;
// Range verification
if (!onlyNew && (minId < 0 || maxId < 0))
{
Console.WriteLine("Please enter a valid range of Redump IDs");
return false;
}
// Update client properties
_client.Debug = DebugInput.Value;
if (attemptCount != null && attemptCount > 0)
@@ -168,9 +162,42 @@ namespace RedumpTool.Features
// Start the processing
Task<List<int>> processingTask;
if (onlyNew)
{
processingTask = _client.DownloadLastModified(outDir, limit);
else
}
else if (minId >= 0 && maxId >= 0)
{
processingTask = _client.DownloadSiteRange(outDir, minId, maxId);
}
else
{
processingTask = _client.DownloadDiscsResults(outDir,
antimodchip,
barcode,
category,
discType,
dumper,
edc,
edition,
errors,
language,
letter,
libcrypt,
media,
offset,
quicksearch,
region,
ringcode,
sort,
sortDir,
status,
system,
tracks,
comments,
contents,
protection,
limit);
}
// Retrieve the result
processingTask.Wait();

View File

@@ -2,7 +2,6 @@ using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using SabreTools.CommandLine.Inputs;
using SabreTools.RedumpLib.Data;
using SabreTools.RedumpLib.Web;
namespace RedumpTool.Features
@@ -47,32 +46,6 @@ namespace RedumpTool.Features
Add(ForceDownloadInput);
Add(ForceContinueInput);
// Discs Path
Add(AntiModchipInput);
Add(BarcodeInput);
Add(CategoryInput);
Add(CommentsInput);
Add(ContentsInput);
Add(DiscTypeInput);
Add(DumperInput);
Add(EdcInput);
Add(EditionInput);
Add(ErrorsInput);
Add(LanguageInput);
Add(LetterInput);
Add(LibCryptInput);
Add(MediaInput);
Add(OffsetInput);
Add(ProtectionInput);
Add(QuickSearchInput);
Add(RegionInput);
Add(RingcodeInput);
Add(SortInput);
Add(SortDirInput);
Add(StatusInput);
Add(SystemInput);
Add(TracksInput);
// Specific
Add(OnlyNewInput);
Add(ListInput);
@@ -91,47 +64,6 @@ namespace RedumpTool.Features
bool forceDownload = ForceDownloadInput.Value;
bool forceContinue = ForceContinueInput.Value;
// Get discs path values
bool? antiModchip = AntiModchipInput.Value;
bool barcode = BarcodeInput.Value;
string? categoryString = CategoryInput.Value;
DiscCategory? category = categoryString.ToDiscCategory();
bool comments = CommentsInput.Value;
bool contents = ContentsInput.Value;
string? discTypeString = DiscTypeInput.Value;
DiscType? discType = discTypeString.ToDiscType();
string? dumper = DumperInput.Value;
bool? edc = EdcInput.Value;
string? edition = EditionInput.Value;
string? errors = ErrorsInput.Value;
string? languageString = LanguageInput.Value;
Language? language = languageString.ToLanguage();
char? letter = string.IsNullOrEmpty(LetterInput.Value)
? null
: LetterInput.Value![0];
bool? libcrypt = LibCryptInput.Value;
MediaType? media = MediaInput.Value?.ToLowerInvariant() switch
{
"cd" => MediaType.CDROM,
"dvd" => MediaType.DVD,
_ => null,
};
int? offset = OffsetInput.Value;
bool protection = ProtectionInput.Value;
string? quicksearch = QuickSearchInput.Value;
string? regionString = RegionInput.Value;
Region? region = regionString.ToRegion();
string? ringcode = RingcodeInput.Value;
string? sortString = SortInput.Value;
SortCategory? sort = sortString.ToSortCategory();
string? sortDirString = SortDirInput.Value;
SortDirection? sortDir = sortDirString.ToSortDirection();
string? statusString = StatusInput.Value;
DumpStatus? status = statusString.ToDumpStatus();
string? systemString = SystemInput.Value;
RedumpSystem? system = systemString.ToRedumpSystem();
int? tracks = TracksInput.Value;
// Get specific values
bool onlyNew = OnlyNewInput.Value;
bool onlyList = ListInput.Value;

View File

@@ -2138,6 +2138,20 @@ namespace SabreTools.RedumpLib.Data
public static string LongName(this YesNo? yesno)
=> AttributeHelper<YesNo?>.GetAttribute(yesno)?.LongName ?? "Yes/No";
/// <summary>
/// Get the YesNo enum value for a given nullable boolean
/// </summary>
/// <param name="yesno">Nullable boolean value to convert</param>
/// <returns>YesNo represented by the nullable boolean, if possible</returns>
public static YesNo ToYesNo(this bool yesno)
{
return yesno switch
{
false => YesNo.No,
true => YesNo.Yes,
};
}
/// <summary>
/// Get the YesNo enum value for a given nullable boolean
/// </summary>