mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Changed padding in version numbers based up how they are stored in the repository.
This commit is contained in:
parent
d89c46f1a9
commit
2255bc9872
@ -1040,11 +1040,16 @@ namespace Emby.Server.Implementations
|
|||||||
return 0;
|
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;
|
string res = string.Empty;
|
||||||
for (int x = start; x < version.Length; x++)
|
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);
|
return long.Parse(res, CultureInfo.InvariantCulture);
|
||||||
@ -1083,11 +1088,11 @@ namespace Emby.Server.Implementations
|
|||||||
var versions = new List<Tuple<long, string, string>>();
|
var versions = new List<Tuple<long, string, string>>();
|
||||||
|
|
||||||
var directories = Directory.EnumerateDirectories(path, "*.*", SearchOption.TopDirectoryOnly).ToList();
|
var directories = Directory.EnumerateDirectories(path, "*.*", SearchOption.TopDirectoryOnly).ToList();
|
||||||
|
|
||||||
// Only add the latest version of the folder into the list.
|
// Only add the latest version of the folder into the list.
|
||||||
foreach (var dir in directories)
|
foreach (var dir in directories)
|
||||||
{
|
{
|
||||||
string[] parts = dir.Split(".");
|
string[] parts = dir.Replace('_', '.').Split(".");
|
||||||
|
|
||||||
if (parts.Length == 1)
|
if (parts.Length == 1)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user