mirror of
https://github.com/duplicati/duplicati.git
synced 2026-05-06 07:16:38 -04:00
a4b33e5d16
Added a free tier for the Office 365 module.
45 lines
1.3 KiB
C#
45 lines
1.3 KiB
C#
// Copyright (c) 2026 Duplicati Inc. All rights reserved.
|
|
|
|
using Duplicati.Library.Interface;
|
|
using Duplicati.Library.Utility;
|
|
using Duplicati.Proprietary.LicenseChecker;
|
|
|
|
namespace Duplicati.Proprietary.LoaderHelper;
|
|
|
|
/// <summary>
|
|
/// Shared list of statically linked restore-destination-provider modules
|
|
/// </summary>
|
|
public static class RestoreDestinationProviderModules
|
|
{
|
|
/// <summary>
|
|
/// The list of all built-in restore-destination-provider modules
|
|
/// </summary>
|
|
public static IReadOnlyList<IRestoreDestinationProviderModule> LicensedRestoreDestinationProviderModules
|
|
{
|
|
get
|
|
{
|
|
// Safegard against errors during loading, e.g. missing libraries
|
|
try
|
|
{
|
|
return LicensedRestoreDestinationProvidersLazy.Value;
|
|
}
|
|
catch
|
|
{
|
|
return Array.Empty<IRestoreDestinationProviderModule>();
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Calculate list once and cache it
|
|
/// </summary>
|
|
private static readonly Lazy<IReadOnlyList<IRestoreDestinationProviderModule>> LicensedRestoreDestinationProvidersLazy = new(() =>
|
|
new IRestoreDestinationProviderModule?[] {
|
|
LicenseHelper.AvailableOffice365FeatureSeats > 0 ? new Office365.RestoreProvider() : null
|
|
}
|
|
.WhereNotNull()
|
|
.ToList()
|
|
);
|
|
}
|
|
|