diff --git a/Beam/DownloadEnumerable.cs b/Beam/DownloadEnumerable.cs index 6f46a65..2855e84 100644 --- a/Beam/DownloadEnumerable.cs +++ b/Beam/DownloadEnumerable.cs @@ -10,5 +10,8 @@ namespace Beam { public IAsyncEnumerator> GetAsyncEnumerator(CancellationToken cancellationToken = default) => Download; + + public static DownloadEnumerable Empty() + => new(Array.Empty>().ToAsyncEnumerable().GetAsyncEnumerator()); } } diff --git a/Beam/SequentialDownloader.cs b/Beam/SequentialDownloader.cs index f4b5d1b..54a7f19 100644 --- a/Beam/SequentialDownloader.cs +++ b/Beam/SequentialDownloader.cs @@ -44,17 +44,17 @@ namespace Beam { List> links = []; //Logger?.LogInformation("MoveNextAsync() \n\t -> Links.Current = {} ", LinksEnumerator.Current.Link.AbsoluteUri); - links.Add(new Ordered(LinksEnumerator.Current.Link.ToString(), LastOrder++)); + links.Add(new Ordered(LinksEnumerator.Current.Link.AbsoluteUri, LastOrder++)); while (LinksEnumerator.MoveNext() && LinksEnumerator.Current != SourceLink.InvalidLink && links.Count < idealLinkCount) - links.Add(new Ordered(LinksEnumerator.Current.Link.ToString(), LastOrder++)); + links.Add(new Ordered(LinksEnumerator.Current.Link.AbsoluteUri, LastOrder++)); //Logger?.LogInformation("MoveNextAsync() \n\t -> links.Count = {} ", links.Count); if (links.Count == 0) { Logger?.LogInformation("Out of links!"); return false; } - if (links.Any((x) => x.Data == SourceLink.InvalidLink.Link.ToString())) + if (links.Any((x) => x.Data == SourceLink.InvalidLink.Link.AbsoluteUri)) return false; var (result, downloadedT) = await unit.TryDownload( diff --git a/Beam/SourceLinkBuilder.cs b/Beam/SourceLinkBuilder.cs index 5e7e68c..9695bb5 100644 --- a/Beam/SourceLinkBuilder.cs +++ b/Beam/SourceLinkBuilder.cs @@ -139,7 +139,7 @@ namespace Beam { /// Produces a deep copy whose and contained collections are detached from the original. /// public SourceLinkBuilder Clone() - => new SourceLinkBuilder(Protocol, Host) { + => new SourceLinkBuilder(Host, Protocol) { Segments = [.. Segments.Select(static x => x.Clone())] }; diff --git a/aeqw89.Beam/aeqw89.Beam.csproj b/aeqw89.Beam/aeqw89.Beam.csproj index 9f5b57b..01c77d4 100644 --- a/aeqw89.Beam/aeqw89.Beam.csproj +++ b/aeqw89.Beam/aeqw89.Beam.csproj @@ -7,7 +7,7 @@ Beam aeqw89 qwsdcvghyu - 1.3.2 + 1.3.6 A library for downloading internet resources https://github.com/qwsdcvghyu89/Beam https://github.com/qwsdcvghyu89/Beam