mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
Make Source methods virtual (#181)
This commit is contained in:
@@ -24,7 +24,7 @@ namespace Velopack.Sources
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<VelopackAssetFeed> GetReleaseFeed(ILogger logger, string channel, Guid? stagingId = null, VelopackAsset? latestLocalRelease = null)
|
||||
public virtual Task<VelopackAssetFeed> GetReleaseFeed(ILogger logger, string channel, Guid? stagingId = null, VelopackAsset? latestLocalRelease = null)
|
||||
{
|
||||
if (!BaseDirectory.Exists) {
|
||||
logger.Error($"The local update directory '{BaseDirectory.FullName}' does not exist.");
|
||||
@@ -64,7 +64,7 @@ namespace Velopack.Sources
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task DownloadReleaseEntry(ILogger logger, VelopackAsset releaseEntry, string localFile, Action<int> progress, CancellationToken cancelToken)
|
||||
public virtual Task DownloadReleaseEntry(ILogger logger, VelopackAsset releaseEntry, string localFile, Action<int> progress, CancellationToken cancelToken)
|
||||
{
|
||||
var releasePath = Path.Combine(BaseDirectory.FullName, releaseEntry.FileName);
|
||||
if (!File.Exists(releasePath))
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Velopack.Sources
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<VelopackAssetFeed> GetReleaseFeed(ILogger logger, string channel, Guid? stagingId = null, VelopackAsset? latestLocalRelease = null)
|
||||
public async virtual Task<VelopackAssetFeed> GetReleaseFeed(ILogger logger, string channel, Guid? stagingId = null, VelopackAsset? latestLocalRelease = null)
|
||||
{
|
||||
var releaseFilename = Utility.GetVeloReleaseIndexName(channel);
|
||||
var uri = Utility.AppendPathToUri(BaseUri, releaseFilename);
|
||||
@@ -61,7 +61,7 @@ namespace Velopack.Sources
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task DownloadReleaseEntry(ILogger logger, VelopackAsset releaseEntry, string localFile, Action<int> progress, CancellationToken cancelToken)
|
||||
public async virtual Task DownloadReleaseEntry(ILogger logger, VelopackAsset releaseEntry, string localFile, Action<int> progress, CancellationToken cancelToken)
|
||||
{
|
||||
if (releaseEntry == null) throw new ArgumentNullException(nameof(releaseEntry));
|
||||
if (localFile == null) throw new ArgumentNullException(nameof(localFile));
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace Velopack.Sources
|
||||
public IFileDownloader Downloader { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<VelopackAssetFeed> GetReleaseFeed(ILogger logger, string channel, Guid? stagingId = null,
|
||||
public async virtual Task<VelopackAssetFeed> GetReleaseFeed(ILogger logger, string channel, Guid? stagingId = null,
|
||||
VelopackAsset? latestLocalRelease = null)
|
||||
{
|
||||
Uri baseUri = new(BaseUri, $"v1.0/manifest/");
|
||||
@@ -65,7 +65,7 @@ namespace Velopack.Sources
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task DownloadReleaseEntry(ILogger logger, VelopackAsset releaseEntry, string localFile, Action<int> progress, CancellationToken cancelToken = default)
|
||||
public async virtual Task DownloadReleaseEntry(ILogger logger, VelopackAsset releaseEntry, string localFile, Action<int> progress, CancellationToken cancelToken = default)
|
||||
{
|
||||
if (releaseEntry is null) throw new ArgumentNullException(nameof(releaseEntry));
|
||||
if (releaseEntry is not VelopackFlowReleaseAsset velopackRelease) {
|
||||
|
||||
Reference in New Issue
Block a user