Rename OneDrive v2 (#5795)

* Change displayname of OneDrive v2

Since OneDrive v1 is removed, there is no need to name the current backend `v2`.

* Renamed everything but the protocol key
This commit is contained in:
Kenneth Skovhede
2024-12-19 22:38:35 +01:00
committed by GitHub
parent b69d9ae37b
commit 8593887184
3 changed files with 31 additions and 31 deletions
@@ -24,7 +24,7 @@ using Duplicati.Library.Interface;
namespace Duplicati.Library.Backend
{
public class OneDriveV2 : MicrosoftGraphBackend
public class OneDrive : MicrosoftGraphBackend
{
private const string DRIVE_ID_OPTION = "drive-id";
private const string DEFAULT_DRIVE_PATH = "/me/drive";
@@ -32,10 +32,10 @@ namespace Duplicati.Library.Backend
private readonly string drivePath;
public OneDriveV2() { } // Constructor needed for dynamic loading to find it
public OneDrive() { } // Constructor needed for dynamic loading to find it
public OneDriveV2(string url, Dictionary<string, string> options)
: base(url, OneDriveV2.PROTOCOL_KEY, options)
public OneDrive(string url, Dictionary<string, string> options)
: base(url, OneDrive.PROTOCOL_KEY, options)
{
string driveId;
if (options.TryGetValue(DRIVE_ID_OPTION, out driveId))
@@ -50,12 +50,12 @@ namespace Duplicati.Library.Backend
public override string ProtocolKey
{
get { return OneDriveV2.PROTOCOL_KEY; }
get { return OneDrive.PROTOCOL_KEY; }
}
public override string DisplayName
{
get { return Strings.OneDriveV2.DisplayName; }
get { return Strings.OneDrive.DisplayName; }
}
protected override string DrivePath
@@ -67,7 +67,7 @@ namespace Duplicati.Library.Backend
{
get
{
return Strings.OneDriveV2.Description;
return Strings.OneDrive.Description;
}
}
@@ -77,7 +77,7 @@ namespace Duplicati.Library.Backend
{
return new ICommandLineArgument[]
{
new CommandLineArgument(DRIVE_ID_OPTION, CommandLineArgument.ArgumentType.String, Strings.OneDriveV2.DriveIdShort, Strings.OneDriveV2.DriveIdLong(DEFAULT_DRIVE_PATH)),
new CommandLineArgument(DRIVE_ID_OPTION, CommandLineArgument.ArgumentType.String, Strings.OneDrive.DriveIdShort, Strings.OneDrive.DriveIdLong(DEFAULT_DRIVE_PATH)),
};
}
}
+22 -22
View File
@@ -1,23 +1,23 @@
// Copyright (C) 2024, The Duplicati Team
// https://duplicati.com, hello@duplicati.com
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
// Copyright (C) 2024, The Duplicati Team
// https://duplicati.com, hello@duplicati.com
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using Duplicati.Library.Localization.Short;
namespace Duplicati.Library.Backend.Strings
{
@@ -36,10 +36,10 @@ namespace Duplicati.Library.Backend.Strings
public static string UseHttpClientShort { get { return LC.L(@"Whether the HttpClient class should be used"); } }
}
internal static class OneDriveV2
internal static class OneDrive
{
public static string Description(string mssadescription, string mssalink, string msopdescription, string msoplink) { return LC.L(@"Store files in Microsoft OneDrive or Microsoft OneDrive for Business via the Microsoft Graph API. Usage of this backend requires that you agree to the terms in {0} ({1}) and {2} ({3}).", mssadescription, mssalink, msopdescription, msoplink); }
public static string DisplayName { get { return LC.L(@"Microsoft OneDrive v2"); } }
public static string DisplayName { get { return LC.L(@"Microsoft OneDrive"); } }
public static string DriveIdLong(string defaultDrive) { return LC.L(@"ID of the drive to store data in. If no drive is specified, the default OneDrive or OneDrive for Business drive will be used via '{0}'.", defaultDrive); }
public static string DriveIdShort { get { return LC.L(@"Optional ID of the drive"); } }
}
+1 -1
View File
@@ -53,7 +53,7 @@ public static class BackendModules
new Backend.Jottacloud(),
new Backend.Mega.MegaBackend(),
new Backend.MicrosoftGroup(),
new Backend.OneDriveV2(),
new Backend.OneDrive(),
new Backend.OpenStack.OpenStackStorage(),
new Backend.Rclone(),
new Backend.S3(),