Refactor downloaders to use ByteDocument and add options builders
Replaces generic RawType with ByteDocument in downloaders and context classes, simplifying type usage. Adds builder classes for FailurePredicateOptions, FragmentOptions, SkipPredicateOptions, and UnitDownloaderOptions to improve configuration flexibility. Introduces DownloadTarget enum and SkipPredicate delegate for more granular download control. Refactors Fluent API interfaces and implementations to remove RawType generics and streamline usage. Adds Playwright and Stealth download strategies for extensibility.
This commit is contained in:
@@ -5,7 +5,7 @@ using Beam.Models;
|
||||
|
||||
namespace Beam.Fluent;
|
||||
|
||||
internal sealed class DownloadStage<RawType, OutType>(DownloadEnumerable<OutType> download) : IDownloadStage<RawType, OutType> where RawType : IDocument {
|
||||
internal sealed class DownloadStage<OutType>(DownloadEnumerable<OutType> download) : IDownloadStage<OutType> {
|
||||
private IAsyncEnumerable<Ordered<OutType>> _download = download;
|
||||
|
||||
public DownloadEnumerable<OutType> AsAsyncEnumerable() {
|
||||
@@ -22,16 +22,16 @@ internal sealed class DownloadStage<RawType, OutType>(DownloadEnumerable<OutType
|
||||
}
|
||||
}
|
||||
|
||||
public IDownloadStage<RawType, OutType> SaveToDirectory(string dir) {
|
||||
public IDownloadStage<OutType> SaveToDirectory(string dir) {
|
||||
_download = _SaveToDirectory(dir);
|
||||
return this;
|
||||
}
|
||||
|
||||
public IDownloadStage<RawType, OutType> SaveToFiles(IEnumerable<string> files) {
|
||||
public IDownloadStage<OutType> SaveToFiles(IEnumerable<string> files) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public IDownloadStage<RawType, OutType> SaveToMemory(ConcurrentBag<OutType> bag) {
|
||||
public IDownloadStage<OutType> SaveToMemory(ConcurrentBag<OutType> bag) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user