diff options
| author | BaronGreenback <jimcartlidge@yahoo.co.uk> | 2020-06-21 18:42:50 +0100 |
|---|---|---|
| committer | BaronGreenback <jimcartlidge@yahoo.co.uk> | 2020-06-21 18:42:50 +0100 |
| commit | 2255bc98722e57e77e191d08b1485372c1e9a400 (patch) | |
| tree | f76a770588418c6e87ebdf18a7ba0e8a6e475664 | |
| parent | d89c46f1a97b436bae0a39816cab71f8d09ad3c3 (diff) | |
Changed padding in version numbers based up how they are stored in the repository.
| -rw-r--r-- | Emby.Server.Implementations/ApplicationHost.cs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index ce907c3ce..22a67b10c 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1040,11 +1040,16 @@ namespace Emby.Server.Implementations return 0; } - // Build version into a string. 1.2.3.4 => 001002003004 (max 999999999999). + // Build version into a string. 1.2.3.4 => 001002003004, 2.1 -> 200100000000. string res = string.Empty; for (int x = start; x < version.Length; x++) { - res += version[x].PadLeft(4 - version[x].Length, '0'); + res += version[x].PadLeft(3, '0'); + } + + if (res.Length < 12) + { + res = res.PadRight(12, '0'); } return long.Parse(res, CultureInfo.InvariantCulture); @@ -1083,11 +1088,11 @@ namespace Emby.Server.Implementations var versions = new List<Tuple<long, string, string>>(); var directories = Directory.EnumerateDirectories(path, "*.*", SearchOption.TopDirectoryOnly).ToList(); - + // Only add the latest version of the folder into the list. foreach (var dir in directories) { - string[] parts = dir.Split("."); + string[] parts = dir.Replace('_', '.').Split("."); if (parts.Length == 1) { |
