Refactor media source handling and update collection options
- Updated `IMediaSourceCatalog` to support user-added media sources, allowing dynamic editing and management of sources. - Removed the `UrlListSource` class as its functionality is now integrated into the new catalog structure. - Enhanced `CollectOptions` to default `RequireProxy` to true, ensuring stricter handling of proxy requirements. - Improved error handling in `ParseError` to include a `Subject` field for better context on failures. - Adjusted dependency injection to reflect changes in media source management, removing old source registrations. - Introduced background proxy checks to ensure a more robust proxy pool management during collection processes. These changes streamline the media collection process and improve the overall user experience by providing clearer error reporting and more flexible source management.
This commit is contained in:
@@ -20,6 +20,15 @@ public sealed record ParseError(int Index, string Message)
|
||||
/// <summary>Values to substitute into the translated message.</summary>
|
||||
public IReadOnlyList<object?> Arguments { get; init; } = [];
|
||||
|
||||
/// <summary>What the failure was about — the address or the line it came from.</summary>
|
||||
/// <remarks>
|
||||
/// Deliberately outside <see cref="Message"/> and <see cref="Arguments"/>: a translated template
|
||||
/// has fixed placeholders, so an address cannot be appended to it without editing every
|
||||
/// translation. The live collection log prints this beside the translated text, which is the
|
||||
/// difference between "the site answered 404" and knowing which of ten thousand ids that was.
|
||||
/// </remarks>
|
||||
public string? Subject { get; init; }
|
||||
|
||||
/// <summary>Creates an error carrying a translation code.</summary>
|
||||
public static ParseError Create(int index, string code, string message, params object?[] arguments) =>
|
||||
new(index, message) { Code = code, Arguments = arguments };
|
||||
|
||||
Reference in New Issue
Block a user