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:
@@ -170,4 +170,18 @@ public class GalleryViewModelTests
|
||||
page.StatusMessage.ShouldNotBeNull().ShouldContain("Could not read the store");
|
||||
page.IsLoading.ShouldBeFalse();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Disposing_twice_is_safe()
|
||||
{
|
||||
// Not hypothetical: every page is registered under its own type and under PageViewModel, so
|
||||
// the container disposes it once per registration. The second call used to cancel an
|
||||
// already-disposed token source and bring the process down on every exit.
|
||||
var (page, _, _) = Build(Media("https://a.test/1.png"));
|
||||
await page.LoadAsync(0, TestContext.Current.CancellationToken);
|
||||
|
||||
page.Dispose();
|
||||
|
||||
Should.NotThrow(page.Dispose);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user