diff --git a/Duplicati/Library/Main/Controller.cs b/Duplicati/Library/Main/Controller.cs index 0794710c4..a71a3c8d0 100644 --- a/Duplicati/Library/Main/Controller.cs +++ b/Duplicati/Library/Main/Controller.cs @@ -1027,6 +1027,9 @@ namespace Duplicati.Library.Main { return Strings.Controller.UnsupportedSizeValue(optionname, value); } + + if (!string.IsNullOrWhiteSpace(value) && char.IsDigit(value.Last())) + return Strings.Controller.NonQualifiedSizeValue(optionname, value); } else if (arg.Type == Duplicati.Library.Interface.CommandLineArgument.ArgumentType.Timespan) { diff --git a/Duplicati/Library/Main/Strings.cs b/Duplicati/Library/Main/Strings.cs index 7862e9b49..131f1e2aa 100644 --- a/Duplicati/Library/Main/Strings.cs +++ b/Duplicati/Library/Main/Strings.cs @@ -28,6 +28,7 @@ namespace Duplicati.Library.Main.Strings public static string FailedForceLocaleError(string exMsg) { return LC.L(@"Failed to apply 'force-locale' setting. Please try to update .NET-Framework. Exception was: ""{0}"" ", exMsg); } public static string SourceVolumeNameInvalidError(string filename) { return LC.L(@"The source {0} uses an invalid volume name, aborting backup", filename); } public static string SourceVolumeNameNotFoundError(string filename, Guid volumeGuid) { return LC.L(@"The source {0} is on volume {1}, which could not be found, aborting backup", filename, volumeGuid); } + public static string NonQualifiedSizeValue(string optionname, string value) { return LC.L(@"The size ""{1}"" supplied to --{0} does not have a multiplier (b, kb, mb, etc). A multiplier is recommended to avoid unexpected changes if the program is updated.", optionname, value); } } internal static class Options diff --git a/Duplicati/Library/Modules/Builtin/ResultSerialization/JsonFormatSerializer.cs b/Duplicati/Library/Modules/Builtin/ResultSerialization/JsonFormatSerializer.cs index f9f9d402a..cd8491f8d 100644 --- a/Duplicati/Library/Modules/Builtin/ResultSerialization/JsonFormatSerializer.cs +++ b/Duplicati/Library/Modules/Builtin/ResultSerialization/JsonFormatSerializer.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Threading.Tasks; using Duplicati.Library.Interface; using Newtonsoft.Json; using Newtonsoft.Json.Converters; @@ -42,7 +43,8 @@ namespace Duplicati.Library.Modules.Builtin.ResultSerialization { return base .CreateProperties(type, memberSerialization) - .Where(x => !m_excludes.Contains(x.PropertyName)) + .Where(x => !m_excludes.Contains(x.PropertyName)) + .Where(x => !typeof(Task).IsAssignableFrom(x.PropertyType)) .ToList(); } } @@ -70,7 +72,8 @@ namespace Duplicati.Library.Modules.Builtin.ResultSerialization ContractResolver = new DynamicContractResolver( nameof(IBasicResults.Warnings), nameof(IBasicResults.Errors), - nameof(IBasicResults.Messages) + nameof(IBasicResults.Messages), + "TaskReader" ), Converters = new List() { diff --git a/Duplicati/Library/Utility/Utility.cs b/Duplicati/Library/Utility/Utility.cs index 75fc1f0e1..a6077995a 100644 --- a/Duplicati/Library/Utility/Utility.cs +++ b/Duplicati/Library/Utility/Utility.cs @@ -1445,6 +1445,11 @@ namespace Duplicati.Library.Utility writer.Write("{0}{1}: ", indentstring, p.Name); PrintSerializeIfPrimitive(p.GetValue(item, null), writer); } + else if (typeof(Task).IsAssignableFrom(p.PropertyType) || p.Name == "TaskReader") + { + // Ignore Task items + continue; + } else if (typeof(System.Collections.IEnumerable).IsAssignableFrom(p.PropertyType)) { var enumerable = (System.Collections.IEnumerable)p.GetValue(item, null); diff --git a/Duplicati/Server/webroot/ngax/scripts/services/AppUtils.js b/Duplicati/Server/webroot/ngax/scripts/services/AppUtils.js index a12a3a113..39e9519fd 100644 --- a/Duplicati/Server/webroot/ngax/scripts/services/AppUtils.js +++ b/Duplicati/Server/webroot/ngax/scripts/services/AppUtils.js @@ -78,7 +78,7 @@ backupApp.service('AppUtils', function($rootScope, $timeout, $cookies, DialogSer function reloadTexts() { apputils.fileSizeMultipliers = [ - {name: gettextCatalog.getString('byte'), value: ''}, + {name: gettextCatalog.getString('byte'), value: 'b'}, {name: gettextCatalog.getString('KByte'), value: 'KB'}, {name: gettextCatalog.getString('MByte'), value: 'MB'}, {name: gettextCatalog.getString('GByte'), value: 'GB'}, @@ -111,7 +111,7 @@ backupApp.service('AppUtils', function($rootScope, $timeout, $cookies, DialogSer ]; apputils.speedMultipliers = [ - {name: gettextCatalog.getString('byte/s'), value: ''}, + {name: gettextCatalog.getString('byte/s'), value: 'b'}, {name: gettextCatalog.getString('KByte/s'), value: 'KB'}, {name: gettextCatalog.getString('MByte/s'), value: 'MB'}, {name: gettextCatalog.getString('GByte/s'), value: 'GB'},