From a041fe8a2dc03790b8b56a01bb2c1d2c9fd9d690 Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Sun, 21 Jun 2020 13:29:35 +0100 Subject: [PATCH 01/46] Add versioning to plugin folders --- .../ApplicationHost.cs | 98 ++++++++++++++++++- .../Updates/InstallationManager.cs | 33 +++++-- 2 files changed, 123 insertions(+), 8 deletions(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 23f0571a1d..a3f76470f5 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1008,6 +1008,102 @@ namespace Emby.Server.Implementations protected abstract void RestartInternal(); + /// + /// Converts an string array to a number. + /// Element 0 is the filename. + /// + /// Parts of the filename. + /// Long representing the version of the file. + private long StrToVersion(string[] version) + { + if (version.Length > 4) + { + Logger.LogError("Plugin version number too complex : {0}.", version[0]); + return -1; + } + + // Build version into a string. 1.2.3.4 => 001002003004 (max 999999999999 + string res = string.Empty; + for (int x = 1; x <= version.Length; x++) + { + res += version[1].PadLeft(3 - version[1].Length, '0'); + } + + return long.Parse(res, CultureInfo.InvariantCulture); + } + + /// + /// Only loads the latest version of each assembly based upon the folder name. + /// eg. MyAssembly 11.9.3.6 - will be ignored. + /// MyAssembly 12.2.3.6 - will be loaded. + /// + /// Path to enumerate. + /// Set to true, to try and clean up earlier versions. + /// IEnumerable{string} of filenames. + protected IEnumerable GetLatestDLLVersion(string path, bool cleanup = false) + { + var dllList = new List(); + var versions = new SortedList(); + var directories = Directory.EnumerateDirectories(path, "*.*", SearchOption.TopDirectoryOnly).ToList(); + var folder = string.Empty; + + // Only add the latest version of the folder into the list. + foreach (var dir in directories) + { + string[] parts = dir.Split("."); + + if (parts.Length == 1) + { + dllList.AddRange(Directory.EnumerateFiles(dir, "*.dll", SearchOption.AllDirectories).ToList()); + } + else + { + // Add for version comparison later. + versions.Add(StrToVersion(parts), parts[0]); + } + } + + if (versions.Count > 0) + { + string lastName = string.Empty; + + // Traverse backwards through the list. + // The first item will be the latest version. + for (int x = versions.Count - 1; x > 0; x--) + { + folder = versions.Values[x]; + if (!string.Equals(lastName, folder, StringComparison.OrdinalIgnoreCase)) + { + dllList.AddRange(Directory.EnumerateFiles(path + "\\" + folder, "*.dll", SearchOption.AllDirectories)); + lastName = folder; + continue; + } + + if (!string.IsNullOrEmpty(lastName) && cleanup) + { + // Attempt a cleanup of old folders. + try + { + Logger.LogDebug("Attempting to delete {0}", path + "\\" + folder); + Directory.Delete(path + "\\" + folder); + } + catch + { + // Ignore errors. + } + } + } + + folder = versions.Values[0]; + if (!string.Equals(lastName, folder, StringComparison.OrdinalIgnoreCase)) + { + dllList.AddRange(Directory.EnumerateFiles(path + "\\" + folder, "*.dll", SearchOption.AllDirectories)); + } + } + + return dllList; + } + /// /// Gets the composable part assemblies. /// @@ -1016,7 +1112,7 @@ namespace Emby.Server.Implementations { if (Directory.Exists(ApplicationPaths.PluginsPath)) { - foreach (var file in Directory.EnumerateFiles(ApplicationPaths.PluginsPath, "*.dll", SearchOption.AllDirectories)) + foreach (var file in GetLatestDLLVersion(ApplicationPaths.PluginsPath)) { Assembly plugAss; try diff --git a/Emby.Server.Implementations/Updates/InstallationManager.cs b/Emby.Server.Implementations/Updates/InstallationManager.cs index 80326fddf2..229e0338c0 100644 --- a/Emby.Server.Implementations/Updates/InstallationManager.cs +++ b/Emby.Server.Implementations/Updates/InstallationManager.cs @@ -16,6 +16,7 @@ using MediaBrowser.Common.Configuration; using MediaBrowser.Common.Net; using MediaBrowser.Common.Plugins; using MediaBrowser.Common.Updates; +using MediaBrowser.Common.System; using MediaBrowser.Controller.Configuration; using MediaBrowser.Model.Events; using MediaBrowser.Model.IO; @@ -23,6 +24,7 @@ using MediaBrowser.Model.Serialization; using MediaBrowser.Model.Updates; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; +using MediaBrowser.Model.System; namespace Emby.Server.Implementations.Updates { @@ -384,9 +386,19 @@ namespace Emby.Server.Implementations.Updates throw new InvalidDataException("The checksum of the received data doesn't match."); } + // Version folder as they cannot be overwritten in Windows. + targetDir += package.Version.ToString(); + if (Directory.Exists(targetDir)) { - Directory.Delete(targetDir, true); + try + { + Directory.Delete(targetDir, true); + } + catch + { + // Ignore any exceptions. + } } stream.Position = 0; @@ -425,15 +437,22 @@ namespace Emby.Server.Implementations.Updates path = file; } - if (isDirectory) + try { - _logger.LogInformation("Deleting plugin directory {0}", path); - Directory.Delete(path, true); + if (isDirectory) + { + _logger.LogInformation("Deleting plugin directory {0}", path); + Directory.Delete(path, true); + } + else + { + _logger.LogInformation("Deleting plugin file {0}", path); + _fileSystem.DeleteFile(path); + } } - else + catch { - _logger.LogInformation("Deleting plugin file {0}", path); - _fileSystem.DeleteFile(path); + // Ignore file errors. } var list = _config.Configuration.UninstalledPlugins.ToList(); From 99410f3c975dbcce44b6cdec2e17e9a8d67db30e Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Sun, 21 Jun 2020 16:15:55 +0100 Subject: [PATCH 02/46] fixes --- .../ApplicationHost.cs | 69 +++++++++++++++---- .../Updates/InstallationManager.cs | 2 +- 2 files changed, 55 insertions(+), 16 deletions(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index a3f76470f5..cbd9f7154a 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1013,25 +1013,62 @@ namespace Emby.Server.Implementations /// Element 0 is the filename. /// /// Parts of the filename. + /// Returns the folder name including any periods. eg. vs /// Long representing the version of the file. - private long StrToVersion(string[] version) + private long StrToVersion(string[] version, out string foldername) { - if (version.Length > 4) + if (version.Length > 5) { Logger.LogError("Plugin version number too complex : {0}.", version[0]); - return -1; + foldername = string.Join('.', version); + return 0; + } + + foldername = string.Empty; + int start = 0; + do + { + foldername += "." + version[start]; + start++; } + while (start < version.Length && !int.TryParse(version[start], out _)); + foldername = foldername.TrimStart('.'); - // Build version into a string. 1.2.3.4 => 001002003004 (max 999999999999 + if (start == version.Length) + { + // No valid version number. + return 0; + } + + // Build version into a string. 1.2.3.4 => 001002003004 (max 999999999999). string res = string.Empty; - for (int x = 1; x <= version.Length; x++) + for (int x = start; x < version.Length; x++) { - res += version[1].PadLeft(3 - version[1].Length, '0'); + res += version[x].PadLeft(4 - version[x].Length, '0'); } return long.Parse(res, CultureInfo.InvariantCulture); } + private static int VersionCompare(Tuple a, Tuple b) + { + int compare = string.Compare(a.Item2, b.Item2, false, CultureInfo.InvariantCulture); + + if (compare == 0) + { + if (a.Item1 > b.Item1) + { + return 1; + } + + return -1; + + } + + return compare; + + } + /// /// Only loads the latest version of each assembly based upon the folder name. /// eg. MyAssembly 11.9.3.6 - will be ignored. @@ -1043,7 +1080,8 @@ namespace Emby.Server.Implementations protected IEnumerable GetLatestDLLVersion(string path, bool cleanup = false) { var dllList = new List(); - var versions = new SortedList(); + var versions = new List>(); + var directories = Directory.EnumerateDirectories(path, "*.*", SearchOption.TopDirectoryOnly).ToList(); var folder = string.Empty; @@ -1058,23 +1096,24 @@ namespace Emby.Server.Implementations } else { + long id = StrToVersion(parts, out string foldername); // Add for version comparison later. - versions.Add(StrToVersion(parts), parts[0]); + versions.Add(Tuple.Create(id, foldername, dir)); } } if (versions.Count > 0) { string lastName = string.Empty; - + versions.Sort(VersionCompare); // Traverse backwards through the list. // The first item will be the latest version. for (int x = versions.Count - 1; x > 0; x--) { - folder = versions.Values[x]; + folder = versions[x].Item2; if (!string.Equals(lastName, folder, StringComparison.OrdinalIgnoreCase)) { - dllList.AddRange(Directory.EnumerateFiles(path + "\\" + folder, "*.dll", SearchOption.AllDirectories)); + dllList.AddRange(Directory.EnumerateFiles(folder, "*.dll", SearchOption.AllDirectories)); lastName = folder; continue; } @@ -1084,8 +1123,8 @@ namespace Emby.Server.Implementations // Attempt a cleanup of old folders. try { - Logger.LogDebug("Attempting to delete {0}", path + "\\" + folder); - Directory.Delete(path + "\\" + folder); + Logger.LogDebug("Attempting to delete {0}", folder); + Directory.Delete(folder); } catch { @@ -1094,10 +1133,10 @@ namespace Emby.Server.Implementations } } - folder = versions.Values[0]; + folder = versions[0].Item2; if (!string.Equals(lastName, folder, StringComparison.OrdinalIgnoreCase)) { - dllList.AddRange(Directory.EnumerateFiles(path + "\\" + folder, "*.dll", SearchOption.AllDirectories)); + dllList.AddRange(Directory.EnumerateFiles(folder, "*.dll", SearchOption.AllDirectories)); } } diff --git a/Emby.Server.Implementations/Updates/InstallationManager.cs b/Emby.Server.Implementations/Updates/InstallationManager.cs index 229e0338c0..b6cd5a6336 100644 --- a/Emby.Server.Implementations/Updates/InstallationManager.cs +++ b/Emby.Server.Implementations/Updates/InstallationManager.cs @@ -387,7 +387,7 @@ namespace Emby.Server.Implementations.Updates } // Version folder as they cannot be overwritten in Windows. - targetDir += package.Version.ToString(); + targetDir += "." + package.Version.ToString(); if (Directory.Exists(targetDir)) { From d89c46f1a97b436bae0a39816cab71f8d09ad3c3 Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Sun, 21 Jun 2020 17:11:21 +0100 Subject: [PATCH 03/46] fixes --- .../ApplicationHost.cs | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index cbd9f7154a..ce907c3cec 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1083,8 +1083,7 @@ namespace Emby.Server.Implementations var versions = new List>(); var directories = Directory.EnumerateDirectories(path, "*.*", SearchOption.TopDirectoryOnly).ToList(); - var folder = string.Empty; - + // Only add the latest version of the folder into the list. foreach (var dir in directories) { @@ -1110,11 +1109,10 @@ namespace Emby.Server.Implementations // The first item will be the latest version. for (int x = versions.Count - 1; x > 0; x--) { - folder = versions[x].Item2; - if (!string.Equals(lastName, folder, StringComparison.OrdinalIgnoreCase)) + if (!string.Equals(lastName, versions[x].Item2, StringComparison.OrdinalIgnoreCase)) { - dllList.AddRange(Directory.EnumerateFiles(folder, "*.dll", SearchOption.AllDirectories)); - lastName = folder; + dllList.AddRange(Directory.EnumerateFiles(versions[x].Item3, "*.dll", SearchOption.AllDirectories)); + lastName = versions[x].Item2; continue; } @@ -1123,8 +1121,8 @@ namespace Emby.Server.Implementations // Attempt a cleanup of old folders. try { - Logger.LogDebug("Attempting to delete {0}", folder); - Directory.Delete(folder); + Logger.LogDebug("Attempting to delete {0}", versions[x].Item3); + Directory.Delete(versions[x].Item3); } catch { @@ -1133,10 +1131,9 @@ namespace Emby.Server.Implementations } } - folder = versions[0].Item2; - if (!string.Equals(lastName, folder, StringComparison.OrdinalIgnoreCase)) + if (!string.Equals(lastName, versions[0].Item2, StringComparison.OrdinalIgnoreCase)) { - dllList.AddRange(Directory.EnumerateFiles(folder, "*.dll", SearchOption.AllDirectories)); + dllList.AddRange(Directory.EnumerateFiles(versions[0].Item3, "*.dll", SearchOption.AllDirectories)); } } From 2255bc98722e57e77e191d08b1485372c1e9a400 Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Sun, 21 Jun 2020 18:42:50 +0100 Subject: [PATCH 04/46] Changed padding in version numbers based up how they are stored in the repository. --- Emby.Server.Implementations/ApplicationHost.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index ce907c3cec..22a67b10cf 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>(); 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) { From bf1bbbdd3e72657d0e36a7a2b80c89d03fc40ba8 Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Sun, 21 Jun 2020 18:46:48 +0100 Subject: [PATCH 05/46] Changed sorting to case insensitive --- Emby.Server.Implementations/ApplicationHost.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 22a67b10cf..830581d192 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1057,7 +1057,7 @@ namespace Emby.Server.Implementations private static int VersionCompare(Tuple a, Tuple b) { - int compare = string.Compare(a.Item2, b.Item2, false, CultureInfo.InvariantCulture); + int compare = string.Compare(a.Item2, b.Item2, true, CultureInfo.InvariantCulture); if (compare == 0) { From a25a233b75df380d87f1fdca8738b32938095ab4 Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Mon, 22 Jun 2020 11:57:46 +0100 Subject: [PATCH 06/46] Using Version class. --- .../ApplicationHost.cs | 128 +++++------------- .../Updates/InstallationManager.cs | 2 +- 2 files changed, 34 insertions(+), 96 deletions(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 830581d192..9d452250d8 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1009,137 +1009,75 @@ namespace Emby.Server.Implementations protected abstract void RestartInternal(); /// - /// Converts an string array to a number. - /// Element 0 is the filename. + /// Comparison function used in <. /// - /// Parts of the filename. - /// Returns the folder name including any periods. eg. vs - /// Long representing the version of the file. - private long StrToVersion(string[] version, out string foldername) - { - if (version.Length > 5) - { - Logger.LogError("Plugin version number too complex : {0}.", version[0]); - foldername = string.Join('.', version); - return 0; - } - - foldername = string.Empty; - int start = 0; - do - { - foldername += "." + version[start]; - start++; - } - while (start < version.Length && !int.TryParse(version[start], out _)); - foldername = foldername.TrimStart('.'); - - if (start == version.Length) - { - // No valid version number. - return 0; - } - - // 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(3, '0'); - } - - if (res.Length < 12) - { - res = res.PadRight(12, '0'); - } - - return long.Parse(res, CultureInfo.InvariantCulture); - } - - private static int VersionCompare(Tuple a, Tuple b) + private static int VersionCompare(Tuple a, Tuple b) { int compare = string.Compare(a.Item2, b.Item2, true, CultureInfo.InvariantCulture); if (compare == 0) { - if (a.Item1 > b.Item1) - { - return 1; - } - - return -1; - + return a.Item1.CompareTo(b.Item1); } return compare; - } /// /// Only loads the latest version of each assembly based upon the folder name. - /// eg. MyAssembly 11.9.3.6 - will be ignored. - /// MyAssembly 12.2.3.6 - will be loaded. + /// eg. MyAssembly_11.9.3.6 - will be ignored. + /// MyAssembly_12.2.3.6 - will be loaded. /// /// Path to enumerate. /// Set to true, to try and clean up earlier versions. /// IEnumerable{string} of filenames. - protected IEnumerable GetLatestDLLVersion(string path, bool cleanup = false) + protected IEnumerable GetLatestDLLVersion(string path, bool cleanup = true) { var dllList = new List(); - var versions = new List>(); + var versions = new List>(); + var directories = Directory.EnumerateDirectories(path, "*.*", SearchOption.TopDirectoryOnly); - 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.Replace('_', '.').Split("."); - - if (parts.Length == 1) + int p = dir.LastIndexOf('_'); + if (p != -1 && Version.TryParse(dir.Substring(p + 1), out Version ver)) { - dllList.AddRange(Directory.EnumerateFiles(dir, "*.dll", SearchOption.AllDirectories).ToList()); + // Versioned folder. + versions.Add(Tuple.Create(ver, dir.Substring(0, p), dir)); } else { - long id = StrToVersion(parts, out string foldername); - // Add for version comparison later. - versions.Add(Tuple.Create(id, foldername, dir)); + // Un-versioned folder. + versions.Add(Tuple.Create(new Version(), dir, dir)); } } - if (versions.Count > 0) + string lastName = string.Empty; + versions.Sort(VersionCompare); + // Traverse backwards through the list. + // The first item will be the latest version. + for (int x = versions.Count - 1; x >= 0; x--) { - string lastName = string.Empty; - versions.Sort(VersionCompare); - // Traverse backwards through the list. - // The first item will be the latest version. - for (int x = versions.Count - 1; x > 0; x--) + if (!string.Equals(lastName, versions[x].Item2, StringComparison.OrdinalIgnoreCase)) { - if (!string.Equals(lastName, versions[x].Item2, StringComparison.OrdinalIgnoreCase)) + dllList.AddRange(Directory.EnumerateFiles(versions[x].Item3, "*.dll", SearchOption.AllDirectories)); + lastName = versions[x].Item2; + continue; + } + + if (!string.IsNullOrEmpty(lastName) && cleanup) + { + // Attempt a cleanup of old folders. + try { - dllList.AddRange(Directory.EnumerateFiles(versions[x].Item3, "*.dll", SearchOption.AllDirectories)); - lastName = versions[x].Item2; - continue; + Logger.LogDebug("Attempting to delete {0}", versions[x].Item3); + Directory.Delete(versions[x].Item3, true); } - - if (!string.IsNullOrEmpty(lastName) && cleanup) + catch { - // Attempt a cleanup of old folders. - try - { - Logger.LogDebug("Attempting to delete {0}", versions[x].Item3); - Directory.Delete(versions[x].Item3); - } - catch - { - // Ignore errors. - } + // Ignore errors. } } - - if (!string.Equals(lastName, versions[0].Item2, StringComparison.OrdinalIgnoreCase)) - { - dllList.AddRange(Directory.EnumerateFiles(versions[0].Item3, "*.dll", SearchOption.AllDirectories)); - } } return dllList; diff --git a/Emby.Server.Implementations/Updates/InstallationManager.cs b/Emby.Server.Implementations/Updates/InstallationManager.cs index b6cd5a6336..1fa71e6739 100644 --- a/Emby.Server.Implementations/Updates/InstallationManager.cs +++ b/Emby.Server.Implementations/Updates/InstallationManager.cs @@ -387,7 +387,7 @@ namespace Emby.Server.Implementations.Updates } // Version folder as they cannot be overwritten in Windows. - targetDir += "." + package.Version.ToString(); + targetDir += "_" + package.Version.ToString(); if (Directory.Exists(targetDir)) { From ba3a9f7d466a84040b53399fbc3ae1673b7466ac Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Mon, 22 Jun 2020 12:14:31 +0100 Subject: [PATCH 07/46] removing stray < character from description. --- Emby.Server.Implementations/ApplicationHost.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 9d452250d8..ae6a82e8b9 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1009,7 +1009,7 @@ namespace Emby.Server.Implementations protected abstract void RestartInternal(); /// - /// Comparison function used in <. + /// Comparison function used in . /// private static int VersionCompare(Tuple a, Tuple b) { From e33824d28667df0344420d42032fbb01e9f8f659 Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Sat, 5 Sep 2020 20:20:15 +0100 Subject: [PATCH 08/46] Changed to named tuples --- .../ApplicationHost.cs | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index ae6a82e8b9..1e298042c5 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1011,13 +1011,15 @@ namespace Emby.Server.Implementations /// /// Comparison function used in . /// - private static int VersionCompare(Tuple a, Tuple b) + private static int VersionCompare( + (Version PluginVersion, string Name, string Path) a, + (Version PluginVersion, string Name, string Path) b) { - int compare = string.Compare(a.Item2, b.Item2, true, CultureInfo.InvariantCulture); + int compare = string.Compare(a.Name, b.Name, true, CultureInfo.InvariantCulture); if (compare == 0) { - return a.Item1.CompareTo(b.Item1); + return a.PluginVersion.CompareTo(b.PluginVersion); } return compare; @@ -1034,7 +1036,7 @@ namespace Emby.Server.Implementations protected IEnumerable GetLatestDLLVersion(string path, bool cleanup = true) { var dllList = new List(); - var versions = new List>(); + var versions = new List<(Version PluginVersion, string Name, string Path)>(); var directories = Directory.EnumerateDirectories(path, "*.*", SearchOption.TopDirectoryOnly); foreach (var dir in directories) @@ -1043,12 +1045,12 @@ namespace Emby.Server.Implementations if (p != -1 && Version.TryParse(dir.Substring(p + 1), out Version ver)) { // Versioned folder. - versions.Add(Tuple.Create(ver, dir.Substring(0, p), dir)); + versions.Add((ver, dir.Substring(0, p), dir)); } else { // Un-versioned folder. - versions.Add(Tuple.Create(new Version(), dir, dir)); + versions.Add((new Version(), dir, dir)); } } @@ -1058,10 +1060,10 @@ namespace Emby.Server.Implementations // The first item will be the latest version. for (int x = versions.Count - 1; x >= 0; x--) { - if (!string.Equals(lastName, versions[x].Item2, StringComparison.OrdinalIgnoreCase)) + if (!string.Equals(lastName, versions[x].Name, StringComparison.OrdinalIgnoreCase)) { - dllList.AddRange(Directory.EnumerateFiles(versions[x].Item3, "*.dll", SearchOption.AllDirectories)); - lastName = versions[x].Item2; + dllList.AddRange(Directory.EnumerateFiles(versions[x].Path, "*.dll", SearchOption.AllDirectories)); + lastName = versions[x].Name; continue; } @@ -1070,8 +1072,8 @@ namespace Emby.Server.Implementations // Attempt a cleanup of old folders. try { - Logger.LogDebug("Attempting to delete {0}", versions[x].Item3); - Directory.Delete(versions[x].Item3, true); + Logger.LogDebug("Attempting to delete {0}", versions[x].Path); + Directory.Delete(versions[x].Path, true); } catch { From 0f6ea123ea1ead19e6efc915e6af62dc4a198329 Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Sat, 5 Sep 2020 20:55:42 +0100 Subject: [PATCH 09/46] Update ApplicationHost.cs --- Emby.Server.Implementations/ApplicationHost.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index d579beb2f2..52c40f4a5e 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Diagnostics; +using System.Globalization; using System.IO; using System.Linq; using System.Net; From 2eff0db804dcc46849ad536ad14c3f5faa0695be Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Tue, 8 Sep 2020 17:49:38 +0100 Subject: [PATCH 10/46] Update Emby.Server.Implementations/ApplicationHost.cs Co-authored-by: Cody Robibero --- Emby.Server.Implementations/ApplicationHost.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 52c40f4a5e..8144718037 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1080,7 +1080,7 @@ namespace Emby.Server.Implementations // Attempt a cleanup of old folders. try { - Logger.LogDebug("Attempting to delete {0}", versions[x].Path); + Logger.LogDebug("Deleting {Path}", versions[x].Path); Directory.Delete(versions[x].Path, true); } catch From a9d8b53658930d062c1f2ddc34715c51aec08ce1 Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Tue, 8 Sep 2020 17:49:55 +0100 Subject: [PATCH 11/46] Update Emby.Server.Implementations/ApplicationHost.cs Co-authored-by: Cody Robibero --- Emby.Server.Implementations/ApplicationHost.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 8144718037..a6b6505bf9 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1083,9 +1083,9 @@ namespace Emby.Server.Implementations Logger.LogDebug("Deleting {Path}", versions[x].Path); Directory.Delete(versions[x].Path, true); } - catch + catch (Exception e) { - // Ignore errors. + Logger.LogWarning(e, "Unable to delete {Path}", versions[x].Path); } } } From f4eb34a9662a2474cf555e1665db517ee41db68e Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Tue, 8 Sep 2020 17:50:19 +0100 Subject: [PATCH 12/46] Update Emby.Server.Implementations/Updates/InstallationManager.cs Co-authored-by: Cody Robibero --- Emby.Server.Implementations/Updates/InstallationManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/Updates/InstallationManager.cs b/Emby.Server.Implementations/Updates/InstallationManager.cs index 81cf18f8df..5af2b7e32f 100644 --- a/Emby.Server.Implementations/Updates/InstallationManager.cs +++ b/Emby.Server.Implementations/Updates/InstallationManager.cs @@ -375,7 +375,7 @@ namespace Emby.Server.Implementations.Updates } // Version folder as they cannot be overwritten in Windows. - targetDir += "_" + package.Version.ToString(); + targetDir += "_" + package.Version; if (Directory.Exists(targetDir)) { From ddfb13f94550b6df7cbe7d6aeb17ab91d4bb2b54 Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Tue, 8 Sep 2020 17:50:37 +0100 Subject: [PATCH 13/46] Update Emby.Server.Implementations/Updates/InstallationManager.cs Co-authored-by: Cody Robibero --- Emby.Server.Implementations/Updates/InstallationManager.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Emby.Server.Implementations/Updates/InstallationManager.cs b/Emby.Server.Implementations/Updates/InstallationManager.cs index 5af2b7e32f..ba0fdfc340 100644 --- a/Emby.Server.Implementations/Updates/InstallationManager.cs +++ b/Emby.Server.Implementations/Updates/InstallationManager.cs @@ -388,7 +388,6 @@ namespace Emby.Server.Implementations.Updates // Ignore any exceptions. } } - stream.Position = 0; _zipClient.ExtractAllFromZip(stream, targetDir, true); From 60e8f47194d0bc7053e5771cd355b1ef628f99a2 Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Tue, 8 Sep 2020 17:52:08 +0100 Subject: [PATCH 14/46] Update ApplicationHost.cs --- Emby.Server.Implementations/ApplicationHost.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index a6b6505bf9..1bc436820e 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1049,11 +1049,11 @@ namespace Emby.Server.Implementations foreach (var dir in directories) { - int p = dir.LastIndexOf('_'); - if (p != -1 && Version.TryParse(dir.Substring(p + 1), out Version ver)) + int underscoreIndex = dir.LastIndexOf('_'); + if (underscoreIndex != -1 && Version.TryParse(dir.Substring(underscoreIndex + 1), out Version ver)) { // Versioned folder. - versions.Add((ver, dir.Substring(0, p), dir)); + versions.Add((ver, dir.Substring(0, underscoreIndex), dir)); } else { From b9c7cce6968482145ab15603dcca218e67d1b2b9 Mon Sep 17 00:00:00 2001 From: Keridos <2742845+Keridos@users.noreply.github.com> Date: Wed, 9 Sep 2020 01:57:09 +0200 Subject: [PATCH 15/46] some testing for AudioBook fix PartNumber detection --- .../AudioBook/AudioBookFilePathParser.cs | 17 +--- Emby.Naming/AudioBook/AudioBookResolver.cs | 2 +- .../AudioBook/AudioBookListResolverTests.cs | 90 +++++++++++++++++++ .../AudioBook/AudioBookResolverTests.cs | 58 ++++++++++++ 4 files changed, 151 insertions(+), 16 deletions(-) create mode 100644 tests/Jellyfin.Naming.Tests/AudioBook/AudioBookListResolverTests.cs create mode 100644 tests/Jellyfin.Naming.Tests/AudioBook/AudioBookResolverTests.cs diff --git a/Emby.Naming/AudioBook/AudioBookFilePathParser.cs b/Emby.Naming/AudioBook/AudioBookFilePathParser.cs index 3c874c62ca..eb9393b0bd 100644 --- a/Emby.Naming/AudioBook/AudioBookFilePathParser.cs +++ b/Emby.Naming/AudioBook/AudioBookFilePathParser.cs @@ -50,27 +50,14 @@ namespace Emby.Naming.AudioBook { if (int.TryParse(value.Value, NumberStyles.Integer, CultureInfo.InvariantCulture, out var intValue)) { - result.ChapterNumber = intValue; + result.PartNumber = intValue; } } } } } - /*var matches = _iRegexProvider.GetRegex("\\d+", RegexOptions.IgnoreCase).Matches(fileName); - if (matches.Count > 0) - { - if (!result.ChapterNumber.HasValue) - { - result.ChapterNumber = int.Parse(matches[0].Groups[0].Value); - } - - if (matches.Count > 1) - { - result.PartNumber = int.Parse(matches[matches.Count - 1].Groups[0].Value); - } - }*/ - result.Success = result.PartNumber.HasValue || result.ChapterNumber.HasValue; + result.Success = result.ChapterNumber.HasValue || result.PartNumber.HasValue; return result; } diff --git a/Emby.Naming/AudioBook/AudioBookResolver.cs b/Emby.Naming/AudioBook/AudioBookResolver.cs index 5466b46379..ed53bd04fa 100644 --- a/Emby.Naming/AudioBook/AudioBookResolver.cs +++ b/Emby.Naming/AudioBook/AudioBookResolver.cs @@ -55,8 +55,8 @@ namespace Emby.Naming.AudioBook { Path = path, Container = container, - PartNumber = parsingResult.PartNumber, ChapterNumber = parsingResult.ChapterNumber, + PartNumber = parsingResult.PartNumber, IsDirectory = isDirectory }; } diff --git a/tests/Jellyfin.Naming.Tests/AudioBook/AudioBookListResolverTests.cs b/tests/Jellyfin.Naming.Tests/AudioBook/AudioBookListResolverTests.cs new file mode 100644 index 0000000000..541bb321cd --- /dev/null +++ b/tests/Jellyfin.Naming.Tests/AudioBook/AudioBookListResolverTests.cs @@ -0,0 +1,90 @@ +using System.Linq; +using Emby.Naming.AudioBook; +using Emby.Naming.Common; +using MediaBrowser.Model.IO; +using Xunit; + +namespace Jellyfin.Naming.Tests.AudioBook +{ + public class AudioBookListResolverTests + { + private readonly NamingOptions _namingOptions = new NamingOptions(); + + [Fact] + public void TestStackAndExtras() + { + // No stacking here because there is no part/disc/etc + var files = new[] + { + "Harry Potter and the Deathly Hallows/Part 1.mp3", + "Harry Potter and the Deathly Hallows/Part 2.mp3", + "Harry Potter and the Deathly Hallows/book.nfo", + + "Batman/Chapter 1.mp3", + "Batman/Chapter 2.mp3", + "Batman/Chapter 3.mp3", + }; + + var resolver = GetResolver(); + + var result = resolver.Resolve(files.Select(i => new FileSystemMetadata + { + IsDirectory = false, + FullName = i + }).ToList()).ToList(); + + Assert.Equal(2, result[0].Files.ToList().Count); + // Assert.Empty(result[0].Extras); FIXME: AudioBookListResolver should resolve extra files properly + Assert.Equal("Harry Potter and the Deathly Hallows", result[0].Name); + + Assert.Equal(3, result[1].Files.ToList().Count); + Assert.Empty(result[1].Extras); + Assert.Equal("Batman", result[1].Name); + } + + [Fact] + public void TestWithMetadata() + { + var files = new[] + { + "Harry Potter and the Deathly Hallows/Chapter 1.ogg", + "Harry Potter and the Deathly Hallows/Harry Potter and the Deathly Hallows.nfo" + }; + + var resolver = GetResolver(); + + var result = resolver.Resolve(files.Select(i => new FileSystemMetadata + { + IsDirectory = false, + FullName = i + }).ToList()).ToList(); + + Assert.Single(result); + } + + [Fact] + public void TestWithExtra() + { + var files = new[] + { + "Harry Potter and the Deathly Hallows/Chapter 1.mp3", + "Harry Potter and the Deathly Hallows/Harry Potter and the Deathly Hallows trailer.mp3" + }; + + var resolver = GetResolver(); + + var result = resolver.Resolve(files.Select(i => new FileSystemMetadata + { + IsDirectory = false, + FullName = i + }).ToList()).ToList(); + + Assert.Single(result); + } + + private AudioBookListResolver GetResolver() + { + return new AudioBookListResolver(_namingOptions); + } + } +} diff --git a/tests/Jellyfin.Naming.Tests/AudioBook/AudioBookResolverTests.cs b/tests/Jellyfin.Naming.Tests/AudioBook/AudioBookResolverTests.cs new file mode 100644 index 0000000000..5da2e93d8d --- /dev/null +++ b/tests/Jellyfin.Naming.Tests/AudioBook/AudioBookResolverTests.cs @@ -0,0 +1,58 @@ +using System.Collections.Generic; +using Emby.Naming.AudioBook; +using Emby.Naming.Common; +using MediaBrowser.Model.Entities; +using Xunit; + +namespace Jellyfin.Naming.Tests.AudioBook +{ + public class AudioBookResolverTests + { + private readonly NamingOptions _namingOptions = new NamingOptions(); + + public static IEnumerable GetResolveFileTestData() + { + yield return new object[] + { + new AudioBookFileInfo() + { + Path = @"/server/AudioBooks/Larry Potter/Larry Potter.mp3", + Container = "mp3", + } + }; + yield return new object[] + { + new AudioBookFileInfo() + { + Path = @"/server/AudioBooks/Berry Potter/Chapter 1 .ogg", + Container = "ogg", + ChapterNumber = 1 + } + }; + yield return new object[] + { + new AudioBookFileInfo() + { + Path = @"/server/AudioBooks/Nerry Potter/Part 3 - Chapter 2.mp3", + Container = "mp3", + ChapterNumber = 2, + PartNumber = 3 + } + }; + } + + [Theory] + [MemberData(nameof(GetResolveFileTestData))] + public void ResolveFile_ValidFileName_Success(AudioBookFileInfo expectedResult) + { + var result = new AudioBookResolver(_namingOptions).Resolve(expectedResult.Path); + + Assert.NotNull(result); + Assert.Equal(result?.Path, expectedResult.Path); + Assert.Equal(result?.Container, expectedResult.Container); + Assert.Equal(result?.ChapterNumber, expectedResult.ChapterNumber); + Assert.Equal(result?.PartNumber, expectedResult.PartNumber); + Assert.Equal(result?.IsDirectory, expectedResult.IsDirectory); + } + } +} From 8eb1eedc8d4b1a287f317013c54ed59a6c29b229 Mon Sep 17 00:00:00 2001 From: Keridos <2742845+Keridos@users.noreply.github.com> Date: Wed, 9 Sep 2020 02:33:59 +0200 Subject: [PATCH 16/46] implement suggested changes --- .../AudioBook/AudioBookListResolverTests.cs | 10 +++++----- .../AudioBook/AudioBookResolverTests.cs | 1 - 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/Jellyfin.Naming.Tests/AudioBook/AudioBookListResolverTests.cs b/tests/Jellyfin.Naming.Tests/AudioBook/AudioBookListResolverTests.cs index 541bb321cd..1084e20bda 100644 --- a/tests/Jellyfin.Naming.Tests/AudioBook/AudioBookListResolverTests.cs +++ b/tests/Jellyfin.Naming.Tests/AudioBook/AudioBookListResolverTests.cs @@ -31,13 +31,13 @@ namespace Jellyfin.Naming.Tests.AudioBook { IsDirectory = false, FullName = i - }).ToList()).ToList(); + })).ToList(); - Assert.Equal(2, result[0].Files.ToList().Count); + Assert.Equal(2, result[0].Files.Count); // Assert.Empty(result[0].Extras); FIXME: AudioBookListResolver should resolve extra files properly Assert.Equal("Harry Potter and the Deathly Hallows", result[0].Name); - Assert.Equal(3, result[1].Files.ToList().Count); + Assert.Equal(3, result[1].Files.Count); Assert.Empty(result[1].Extras); Assert.Equal("Batman", result[1].Name); } @@ -57,7 +57,7 @@ namespace Jellyfin.Naming.Tests.AudioBook { IsDirectory = false, FullName = i - }).ToList()).ToList(); + })); Assert.Single(result); } @@ -77,7 +77,7 @@ namespace Jellyfin.Naming.Tests.AudioBook { IsDirectory = false, FullName = i - }).ToList()).ToList(); + })).ToList(); Assert.Single(result); } diff --git a/tests/Jellyfin.Naming.Tests/AudioBook/AudioBookResolverTests.cs b/tests/Jellyfin.Naming.Tests/AudioBook/AudioBookResolverTests.cs index 5da2e93d8d..0d29f1703c 100644 --- a/tests/Jellyfin.Naming.Tests/AudioBook/AudioBookResolverTests.cs +++ b/tests/Jellyfin.Naming.Tests/AudioBook/AudioBookResolverTests.cs @@ -1,7 +1,6 @@ using System.Collections.Generic; using Emby.Naming.AudioBook; using Emby.Naming.Common; -using MediaBrowser.Model.Entities; using Xunit; namespace Jellyfin.Naming.Tests.AudioBook From ba777039ef6635332c8a92c03d558a7ce8e75b7e Mon Sep 17 00:00:00 2001 From: Keridos <2742845+Keridos@users.noreply.github.com> Date: Wed, 9 Sep 2020 02:43:06 +0200 Subject: [PATCH 17/46] remove unnecessary nullchecks --- .../AudioBook/AudioBookResolverTests.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/Jellyfin.Naming.Tests/AudioBook/AudioBookResolverTests.cs b/tests/Jellyfin.Naming.Tests/AudioBook/AudioBookResolverTests.cs index 0d29f1703c..83d44721c4 100644 --- a/tests/Jellyfin.Naming.Tests/AudioBook/AudioBookResolverTests.cs +++ b/tests/Jellyfin.Naming.Tests/AudioBook/AudioBookResolverTests.cs @@ -47,11 +47,11 @@ namespace Jellyfin.Naming.Tests.AudioBook var result = new AudioBookResolver(_namingOptions).Resolve(expectedResult.Path); Assert.NotNull(result); - Assert.Equal(result?.Path, expectedResult.Path); - Assert.Equal(result?.Container, expectedResult.Container); - Assert.Equal(result?.ChapterNumber, expectedResult.ChapterNumber); - Assert.Equal(result?.PartNumber, expectedResult.PartNumber); - Assert.Equal(result?.IsDirectory, expectedResult.IsDirectory); + Assert.Equal(result.Path, expectedResult.Path); + Assert.Equal(result.Container, expectedResult.Container); + Assert.Equal(result.ChapterNumber, expectedResult.ChapterNumber); + Assert.Equal(result.PartNumber, expectedResult.PartNumber); + Assert.Equal(result.IsDirectory, expectedResult.IsDirectory); } } } From b88cfa802f2274b898a3b4e178700ab438c767e0 Mon Sep 17 00:00:00 2001 From: derchu <71195282+derchu@users.noreply.github.com> Date: Sat, 12 Sep 2020 14:46:29 -0700 Subject: [PATCH 18/46] Grab content rating from episode info --- MediaBrowser.Providers/Plugins/TheTvdb/TvdbEpisodeProvider.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/MediaBrowser.Providers/Plugins/TheTvdb/TvdbEpisodeProvider.cs b/MediaBrowser.Providers/Plugins/TheTvdb/TvdbEpisodeProvider.cs index c088d8cec1..5fa8a3e1ca 100644 --- a/MediaBrowser.Providers/Plugins/TheTvdb/TvdbEpisodeProvider.cs +++ b/MediaBrowser.Providers/Plugins/TheTvdb/TvdbEpisodeProvider.cs @@ -141,6 +141,7 @@ namespace MediaBrowser.Providers.Plugins.TheTvdb Name = episode.EpisodeName, Overview = episode.Overview, CommunityRating = (float?)episode.SiteRating, + OfficialRating = episode.ContentRating, } }; result.ResetPeople(); From 81f655803d50ce75c270d06d409d1f1c190a6d79 Mon Sep 17 00:00:00 2001 From: Jim Cartlidge Date: Sun, 13 Sep 2020 16:30:04 +0100 Subject: [PATCH 19/46] Modified to work with manifests. --- .../ApplicationHost.cs | 43 +++++++++++-------- .../Plugins/PlugInManifest.cs | 32 ++++++++++++++ 2 files changed, 57 insertions(+), 18 deletions(-) create mode 100644 Emby.Server.Implementations/Plugins/PlugInManifest.cs diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 1bc436820e..89752c63c0 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -38,6 +38,7 @@ using Emby.Server.Implementations.LiveTv; using Emby.Server.Implementations.Localization; using Emby.Server.Implementations.Net; using Emby.Server.Implementations.Playlists; +using Emby.Server.Implementations.Plugins; using Emby.Server.Implementations.QuickConnect; using Emby.Server.Implementations.ScheduledTasks; using Emby.Server.Implementations.Security; @@ -1020,7 +1021,7 @@ namespace Emby.Server.Implementations /// Comparison function used in . /// private static int VersionCompare( - (Version PluginVersion, string Name, string Path) a, + (Version PluginVersion, string Name, string Path) a, (Version PluginVersion, string Name, string Path) b) { int compare = string.Compare(a.Name, b.Name, true, CultureInfo.InvariantCulture); @@ -1033,32 +1034,38 @@ namespace Emby.Server.Implementations return compare; } - /// - /// Only loads the latest version of each assembly based upon the folder name. - /// eg. MyAssembly_11.9.3.6 - will be ignored. - /// MyAssembly_12.2.3.6 - will be loaded. - /// - /// Path to enumerate. - /// Set to true, to try and clean up earlier versions. - /// IEnumerable{string} of filenames. - protected IEnumerable GetLatestDLLVersion(string path, bool cleanup = true) + private IEnumerable GetPlugins(string path, bool cleanup = true) { var dllList = new List(); var versions = new List<(Version PluginVersion, string Name, string Path)>(); var directories = Directory.EnumerateDirectories(path, "*.*", SearchOption.TopDirectoryOnly); + var serializer = new JsonSerializer(); foreach (var dir in directories) { - int underscoreIndex = dir.LastIndexOf('_'); - if (underscoreIndex != -1 && Version.TryParse(dir.Substring(underscoreIndex + 1), out Version ver)) + try { - // Versioned folder. - versions.Add((ver, dir.Substring(0, underscoreIndex), dir)); + var manifest = serializer.DeserializeFromFile(dir + "\\meta.json"); + + if (!Version.TryParse(manifest.TargetAbi, out var targetAbi)) + { + targetAbi = new Version("0.0.0.1"); + } + + if (!Version.TryParse(manifest.Version, out var version)) + { + version = new Version("0.0.0.1"); + } + + if (targetAbi <= ApplicationVersion) + { + // Only load Plugins for this version or below. + versions.Add((version, manifest.Name, dir)); + } } - else + catch { - // Un-versioned folder. - versions.Add((new Version(), dir, dir)); + continue; } } @@ -1101,7 +1108,7 @@ namespace Emby.Server.Implementations { if (Directory.Exists(ApplicationPaths.PluginsPath)) { - foreach (var file in GetLatestDLLVersion(ApplicationPaths.PluginsPath)) + foreach (var file in GetPlugins(ApplicationPaths.PluginsPath)) { Assembly plugAss; try diff --git a/Emby.Server.Implementations/Plugins/PlugInManifest.cs b/Emby.Server.Implementations/Plugins/PlugInManifest.cs new file mode 100644 index 0000000000..e334d65e50 --- /dev/null +++ b/Emby.Server.Implementations/Plugins/PlugInManifest.cs @@ -0,0 +1,32 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System; + +namespace Emby.Server.Implementations.Plugins +{ + /// + /// Defines a Plugin manifest file. + /// + public class PlugInManifest + { + public string Category { get; set; } + + public string Changelog { get; set; } + + public string Description { get; set; } + + public Guid Guid { get; set; } + + public string Name { get; set; } + + public string Overview { get; set; } + + public string Owner { get; set; } + + public string TargetAbi { get; set; } + + public DateTime Timestamp { get; set; } + + public string Version { get; set; } +} +} From 5f58d2c15183736098ca9e4cb7397ea9fb75d5d1 Mon Sep 17 00:00:00 2001 From: Jim Cartlidge Date: Sun, 13 Sep 2020 16:37:20 +0100 Subject: [PATCH 20/46] With method comments. --- Emby.Server.Implementations/ApplicationHost.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 89752c63c0..7f17419399 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1020,6 +1020,9 @@ namespace Emby.Server.Implementations /// /// Comparison function used in . /// + /// Item to compare. + /// Item to compare with. + /// Boolean result of the operation. private static int VersionCompare( (Version PluginVersion, string Name, string Path) a, (Version PluginVersion, string Name, string Path) b) @@ -1034,6 +1037,12 @@ namespace Emby.Server.Implementations return compare; } + /// + /// Returns a list of plugsin to install. + /// + /// Path to check. + /// True if an attempt should be made to delete old plugs. + /// Enumerable list of dlls to load. private IEnumerable GetPlugins(string path, bool cleanup = true) { var dllList = new List(); From b4edb7c90d82a8a3e1e542e0e5e26cb3a1f70a6a Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Sun, 13 Sep 2020 17:24:02 +0100 Subject: [PATCH 21/46] Update Emby.Server.Implementations/ApplicationHost.cs Co-authored-by: Cody Robibero --- Emby.Server.Implementations/ApplicationHost.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 7f17419399..9aeb0c42a2 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1058,7 +1058,7 @@ namespace Emby.Server.Implementations if (!Version.TryParse(manifest.TargetAbi, out var targetAbi)) { - targetAbi = new Version("0.0.0.1"); + targetAbi = new Version(0, 0, 0, 1); } if (!Version.TryParse(manifest.Version, out var version)) From 008aa51eb731c926df3c584fed8d7ccad1d8c94a Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Sun, 13 Sep 2020 17:24:30 +0100 Subject: [PATCH 22/46] Update Emby.Server.Implementations/ApplicationHost.cs Co-authored-by: Cody Robibero --- Emby.Server.Implementations/ApplicationHost.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 9aeb0c42a2..cf55f392d8 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1063,7 +1063,7 @@ namespace Emby.Server.Implementations if (!Version.TryParse(manifest.Version, out var version)) { - version = new Version("0.0.0.1"); + version = new Version(0, 0, 0, 1); } if (targetAbi <= ApplicationVersion) From 12fb827405473d9f499848ce2098008fc96d0321 Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Sun, 13 Sep 2020 17:29:10 +0100 Subject: [PATCH 23/46] Update Emby.Server.Implementations/ApplicationHost.cs Co-authored-by: Cody Robibero --- Emby.Server.Implementations/ApplicationHost.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index cf55f392d8..db70b6203c 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1054,7 +1054,7 @@ namespace Emby.Server.Implementations { try { - var manifest = serializer.DeserializeFromFile(dir + "\\meta.json"); + var manifest = serializer.DeserializeFromFile(Path.Combine(dir, "meta.json"); if (!Version.TryParse(manifest.TargetAbi, out var targetAbi)) { From ea0eb9a6ffc8a667c9d9d455121d3f48d72fa360 Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Sun, 13 Sep 2020 17:42:40 +0100 Subject: [PATCH 24/46] Update PlugInManifest.cs Added comments. --- .../Plugins/PlugInManifest.cs | 34 +++++++++++++++++-- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/Emby.Server.Implementations/Plugins/PlugInManifest.cs b/Emby.Server.Implementations/Plugins/PlugInManifest.cs index e334d65e50..fa48d73c55 100644 --- a/Emby.Server.Implementations/Plugins/PlugInManifest.cs +++ b/Emby.Server.Implementations/Plugins/PlugInManifest.cs @@ -1,5 +1,3 @@ -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - using System; namespace Emby.Server.Implementations.Plugins @@ -9,24 +7,54 @@ namespace Emby.Server.Implementations.Plugins /// public class PlugInManifest { + /// + /// Gets or sets the category of the plugin. + /// public string Category { get; set; } + /// + /// Gets or sets the changelog information. + /// public string Changelog { get; set; } + /// + /// Gets or sets the description of the plugin. + /// public string Description { get; set; } + /// + /// Gets or sets the Global Unique Identifier for the plugin. + /// public Guid Guid { get; set; } + /// + /// Gets or sets the Name of the plugin. + /// public string Name { get; set; } + /// + /// Gets or sets an overview of the plugin. + /// public string Overview { get; set; } + /// + /// Gets or sets the owner of the plugin. + /// public string Owner { get; set; } + /// + /// Gets or sets the compatibility version for the plugin. + /// public string TargetAbi { get; set; } + /// + /// Gets or sets the timestamp of the plugin. + /// public DateTime Timestamp { get; set; } + /// + /// Gets or sets the Version number of the plugin. + /// public string Version { get; set; } -} + } } From 6c2c2cb872b0e98ff27d1cc8d664a185e63e39ac Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Sun, 13 Sep 2020 17:45:17 +0100 Subject: [PATCH 25/46] Update ApplicationHost.cs Global jsonserializer added --- Emby.Server.Implementations/ApplicationHost.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index db70b6203c..ea4c77f3cc 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -121,6 +121,7 @@ namespace Emby.Server.Implementations private readonly IFileSystem _fileSystemManager; private readonly INetworkManager _networkManager; private readonly IXmlSerializer _xmlSerializer; + private readonly IJsonSerializer _jsonSerializer; private readonly IStartupOptions _startupOptions; private IMediaEncoder _mediaEncoder; @@ -251,6 +252,8 @@ namespace Emby.Server.Implementations IServiceCollection serviceCollection) { _xmlSerializer = new MyXmlSerializer(); + _jsonSerializer = new JsonSerializer(); + ServiceCollection = serviceCollection; _networkManager = networkManager; @@ -1049,12 +1052,11 @@ namespace Emby.Server.Implementations var versions = new List<(Version PluginVersion, string Name, string Path)>(); var directories = Directory.EnumerateDirectories(path, "*.*", SearchOption.TopDirectoryOnly); - var serializer = new JsonSerializer(); foreach (var dir in directories) { try { - var manifest = serializer.DeserializeFromFile(Path.Combine(dir, "meta.json"); + var manifest = _jsonSerializer.DeserializeFromFile(Path.Combine(dir, "meta.json"); if (!Version.TryParse(manifest.TargetAbi, out var targetAbi)) { From 107d606a7069e43bafacd0e8254631230219111f Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Sun, 13 Sep 2020 17:51:14 +0100 Subject: [PATCH 26/46] Update ApplicationHost.cs --- Emby.Server.Implementations/ApplicationHost.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index ea4c77f3cc..9540a879af 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1056,7 +1056,7 @@ namespace Emby.Server.Implementations { try { - var manifest = _jsonSerializer.DeserializeFromFile(Path.Combine(dir, "meta.json"); + var manifest = _jsonSerializer.DeserializeFromFile(Path.Combine(dir, "meta.json")); if (!Version.TryParse(manifest.TargetAbi, out var targetAbi)) { From 7b4b101ecacb6026cf2ca4142f0ca0fbb0f637fd Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Sun, 13 Sep 2020 18:06:13 +0100 Subject: [PATCH 27/46] Update ApplicationHost.cs --- Emby.Server.Implementations/ApplicationHost.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 9540a879af..2206fabadf 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1021,7 +1021,7 @@ namespace Emby.Server.Implementations protected abstract void RestartInternal(); /// - /// Comparison function used in . + /// Comparison function used in . /// /// Item to compare. /// Item to compare with. @@ -1068,7 +1068,7 @@ namespace Emby.Server.Implementations version = new Version(0, 0, 0, 1); } - if (targetAbi <= ApplicationVersion) + if (targetAbi >= ApplicationVersion) { // Only load Plugins for this version or below. versions.Add((version, manifest.Name, dir)); From 58924fd1da70cfdbdde835d302dca0812b984187 Mon Sep 17 00:00:00 2001 From: Oleg Shevchenko Date: Sun, 13 Sep 2020 22:38:31 +0300 Subject: [PATCH 28/46] Fix parameters validation in ImageProcessor.GetCachePath --- CONTRIBUTORS.md | 1 + Emby.Drawing/ImageProcessor.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index f0724b4129..f1fe65064b 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -198,3 +198,4 @@ - [tikuf](https://github.com/tikuf/) - [Tim Hobbs](https://github.com/timhobbs) - [SvenVandenbrande](https://github.com/SvenVandenbrande) + - [olsh](https://github.com/olsh) diff --git a/Emby.Drawing/ImageProcessor.cs b/Emby.Drawing/ImageProcessor.cs index f585b90ca1..ed20292f6b 100644 --- a/Emby.Drawing/ImageProcessor.cs +++ b/Emby.Drawing/ImageProcessor.cs @@ -455,7 +455,7 @@ namespace Emby.Drawing throw new ArgumentException("Path can't be empty.", nameof(path)); } - if (path.IsEmpty) + if (filename.IsEmpty) { throw new ArgumentException("Filename can't be empty.", nameof(filename)); } From 17f66b49430f5fed7475de6a3400326dca2ec143 Mon Sep 17 00:00:00 2001 From: kevin Date: Mon, 14 Sep 2020 10:39:04 +0000 Subject: [PATCH 29/46] Added translation using Weblate (Albanian) --- Emby.Server.Implementations/Localization/Core/sq.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 Emby.Server.Implementations/Localization/Core/sq.json diff --git a/Emby.Server.Implementations/Localization/Core/sq.json b/Emby.Server.Implementations/Localization/Core/sq.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/Emby.Server.Implementations/Localization/Core/sq.json @@ -0,0 +1 @@ +{} From 3a75365930c652d6c278e225f0c5ff23538216db Mon Sep 17 00:00:00 2001 From: kevin Date: Mon, 14 Sep 2020 10:39:45 +0000 Subject: [PATCH 30/46] Translated using Weblate (Albanian) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/sq/ --- .../Localization/Core/sq.json | 118 +++++++++++++++++- 1 file changed, 117 insertions(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/Localization/Core/sq.json b/Emby.Server.Implementations/Localization/Core/sq.json index 0967ef424b..347ba5f970 100644 --- a/Emby.Server.Implementations/Localization/Core/sq.json +++ b/Emby.Server.Implementations/Localization/Core/sq.json @@ -1 +1,117 @@ -{} +{ + "MessageApplicationUpdatedTo": "Serveri Jellyfin u përditesua në versionin {0}", + "Inherit": "Trashgimi", + "TaskDownloadMissingSubtitlesDescription": "Kërkon në internet për titra që mungojnë bazuar tek konfigurimi i metadata-ve.", + "TaskDownloadMissingSubtitles": "Shkarko titra që mungojnë", + "TaskRefreshChannelsDescription": "Rifreskon informacionin e kanaleve të internetit.", + "TaskRefreshChannels": "Rifresko Kanalet", + "TaskCleanTranscodeDescription": "Fshin skedarët e transkodimit që janë më të vjetër se një ditë.", + "TaskCleanTranscode": "Fshi dosjen e transkodimit", + "TaskUpdatePluginsDescription": "Shkarkon dhe instalon përditësimi për plugin që janë konfiguruar të përditësohen automatikisht.", + "TaskUpdatePlugins": "Përditëso Plugin", + "TaskRefreshPeopleDescription": "Përditëson metadata të aktorëve dhe regjizorëve në librarinë tuaj.", + "TaskRefreshPeople": "Rifresko aktorët", + "TaskCleanLogsDescription": "Fshin skëdarët log që janë më të vjetër se {0} ditë.", + "TaskCleanLogs": "Fshi dosjen Log", + "TaskRefreshLibraryDescription": "Skanon librarinë media për skedarë të rinj dhe rifreskon metadata.", + "TaskRefreshLibrary": "Skano librarinë media", + "TaskRefreshChapterImagesDescription": "Krijon imazh për videot që kanë kapituj.", + "TaskRefreshChapterImages": "Ekstrakto Imazhet e Kapitullit", + "TaskCleanCacheDescription": "Fshi skedarët e cache-s që nuk i duhen më sistemit.", + "TaskCleanCache": "Pastro memorjen cache", + "TasksChannelsCategory": "Kanalet nga interneti", + "TasksApplicationCategory": "Aplikacioni", + "TasksLibraryCategory": "Libraria", + "TasksMaintenanceCategory": "Mirëmbajtje", + "VersionNumber": "Versioni {0}", + "ValueSpecialEpisodeName": "Speciale - {0}", + "ValueHasBeenAddedToLibrary": "{0} u shtua tek libraria juaj", + "UserStoppedPlayingItemWithValues": "{0} mbaroi së shikuari {1} tek {2}", + "UserStartedPlayingItemWithValues": "{0} po shikon {1} tek {2}", + "UserPolicyUpdatedWithName": "Politika e përdoruesit u përditësua për {0}", + "UserPasswordChangedWithName": "Fjalëkalimi u ndryshua për përdoruesin {0}", + "UserOnlineFromDevice": "{0} është në linjë nga {1}", + "UserOfflineFromDevice": "{0} u shkëput nga {1}", + "UserLockedOutWithName": "Përdoruesi {0} u përjashtua", + "UserDownloadingItemWithValues": "{0} po shkarkon {1}", + "UserDeletedWithName": "Përdoruesi {0} u fshi", + "UserCreatedWithName": "Përdoruesi {0} u krijua", + "User": "Përdoruesi", + "TvShows": "Seriale TV", + "System": "Sistemi", + "Sync": "Sinkronizo", + "SubtitleDownloadFailureFromForItem": "Titrat deshtuan të shkarkohen nga {0} për {1}", + "StartupEmbyServerIsLoading": "Serveri Jellyfin po ngarkohet. Ju lutemi provoni përseri pas pak.", + "Songs": "Këngë", + "Shows": "Seriale", + "ServerNameNeedsToBeRestarted": "{0} duhet të ristartoj", + "ScheduledTaskStartedWithName": "{0} filloi", + "ScheduledTaskFailedWithName": "{0} dështoi", + "ProviderValue": "Ofruesi: {0}", + "PluginUpdatedWithName": "{0} u përditësua", + "PluginUninstalledWithName": "{0} u çinstalua", + "PluginInstalledWithName": "{0} u instalua", + "Plugin": "Plugin", + "Playlists": "Listat për luajtje", + "Photos": "Fotografitë", + "NotificationOptionVideoPlaybackStopped": "Luajtja e videos ndaloi", + "NotificationOptionVideoPlayback": "Luajtja e videos filloi", + "NotificationOptionUserLockedOut": "Përdoruesi u përjashtua", + "NotificationOptionTaskFailed": "Ushtrimi i planifikuar dështoi", + "NotificationOptionServerRestartRequired": "Kërkohet ristartim i serverit", + "NotificationOptionPluginUpdateInstalled": "Përditësimi i plugin u instalua", + "NotificationOptionPluginUninstalled": "Plugin u çinstalua", + "NotificationOptionPluginInstalled": "Plugin u instalua", + "NotificationOptionPluginError": "Plugin dështoi", + "NotificationOptionNewLibraryContent": "Një përmbajtje e re u shtua", + "NotificationOptionInstallationFailed": "Instalimi dështoi", + "NotificationOptionCameraImageUploaded": "Fotoja nga kamera u ngarkua", + "NotificationOptionAudioPlaybackStopped": "Luajtja e audios ndaloi", + "NotificationOptionAudioPlayback": "Luajtja e audios filloi", + "NotificationOptionApplicationUpdateInstalled": "Përditësimi i aplikacionit u instalua", + "NotificationOptionApplicationUpdateAvailable": "Një perditësim i aplikacionit është gati", + "NewVersionIsAvailable": "Një version i ri i Jellyfin është gati për tu shkarkuar.", + "NameSeasonUnknown": "Sezon i panjohur", + "NameSeasonNumber": "Sezoni {0}", + "NameInstallFailed": "Instalimi i {0} dështoi", + "MusicVideos": "Video muzikore", + "Music": "Muzikë", + "Movies": "Filma", + "MixedContent": "Përmbajtje e përzier", + "MessageServerConfigurationUpdated": "Konfigurimet e serverit u përditësuan", + "MessageNamedServerConfigurationUpdatedWithValue": "Seksioni i konfigurimit të serverit {0} u përditësua", + "MessageApplicationUpdated": "Serveri Jellyfin u përditësua", + "Latest": "Të fundit", + "LabelRunningTimeValue": "Kohëzgjatja: {0}", + "LabelIpAddressValue": "Adresa IP: {0}", + "ItemRemovedWithName": "{0} u fshi nga libraria", + "ItemAddedWithName": "{0} u shtua tek libraria", + "HomeVideos": "Video personale", + "HeaderRecordingGroups": "Grupet e regjistrimit", + "HeaderNextUp": "Në vazhdim", + "HeaderLiveTV": "TV Live", + "HeaderFavoriteSongs": "Kënget e preferuara", + "HeaderFavoriteShows": "Serialet e preferuar", + "HeaderFavoriteEpisodes": "Episodet e preferuar", + "HeaderFavoriteArtists": "Artistët e preferuar", + "HeaderFavoriteAlbums": "Albumet e preferuar", + "HeaderContinueWatching": "Vazhdo të shikosh", + "HeaderCameraUploads": "Ngarkimet nga Kamera", + "HeaderAlbumArtists": "Artistët e albumeve", + "Genres": "Zhanre", + "Folders": "Dosje", + "Favorites": "Të preferuara", + "FailedLoginAttemptWithUserName": "Përpjekja për hyrje dështoi nga {0}", + "DeviceOnlineWithName": "{0} u lidh", + "DeviceOfflineWithName": "{0} u shkëput", + "Collections": "Koleksione", + "ChapterNameValue": "Kapituj", + "Channels": "Kanale", + "CameraImageUploadedFrom": "Një foto e re nga kamera u ngarkua nga {0}", + "Books": "Libra", + "AuthenticationSucceededWithUserName": "{0} u identifikua me sukses", + "Artists": "Artistë", + "Application": "Aplikacioni", + "AppDeviceValues": "Aplikacioni: {0}, Pajisja: {1}", + "Albums": "Albumet" +} From b83b8f526729771ce52571bf6447a2d5eeac4b8d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Sep 2020 12:02:19 +0000 Subject: [PATCH 31/46] Bump SkiaSharp from 2.80.1 to 2.80.2 Bumps SkiaSharp from 2.80.1 to 2.80.2. Signed-off-by: dependabot[bot] --- Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj b/Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj index c71c76f08f..6b378034a5 100644 --- a/Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj +++ b/Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj @@ -20,7 +20,7 @@ - + From fc827a7b25114e0b987cf913702a242e2f9b89a2 Mon Sep 17 00:00:00 2001 From: hoanghuy309 Date: Mon, 14 Sep 2020 12:12:19 +0000 Subject: [PATCH 32/46] Added translation using Weblate (Vietnamese) --- Emby.Server.Implementations/Localization/Core/vi.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 Emby.Server.Implementations/Localization/Core/vi.json diff --git a/Emby.Server.Implementations/Localization/Core/vi.json b/Emby.Server.Implementations/Localization/Core/vi.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/Emby.Server.Implementations/Localization/Core/vi.json @@ -0,0 +1 @@ +{} From 9183688cabc9b221abc0c2b7a64afd09203aaff2 Mon Sep 17 00:00:00 2001 From: hoanghuy309 Date: Mon, 14 Sep 2020 12:13:31 +0000 Subject: [PATCH 33/46] Translated using Weblate (Vietnamese) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/vi/ --- .../Localization/Core/vi.json | 118 +++++++++++++++++- 1 file changed, 117 insertions(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/Localization/Core/vi.json b/Emby.Server.Implementations/Localization/Core/vi.json index 0967ef424b..8b4334d7a6 100644 --- a/Emby.Server.Implementations/Localization/Core/vi.json +++ b/Emby.Server.Implementations/Localization/Core/vi.json @@ -1 +1,117 @@ -{} +{ + "Collections": "Bộ Sưu Tập", + "Favorites": "Sở Thích", + "Folders": "Thư Mục", + "Genres": "Thể Loại", + "HeaderAlbumArtists": "Bộ Sưu Tập Nghệ sĩ", + "HeaderContinueWatching": "Tiếp Tục Xem", + "HeaderLiveTV": "TV Trực Tiếp", + "Movies": "Phim", + "Photos": "Ảnh", + "Playlists": "Danh Sách Chơi", + "Shows": "Các Chương Trình", + "Songs": "Các Bài Hát", + "Sync": "Đồng Bộ", + "ValueSpecialEpisodeName": "Đặc Biệt - {0}", + "Albums": "Bộ Sưu Tập", + "Artists": "Nghệ Sĩ", + "TaskDownloadMissingSubtitlesDescription": "Tìm kiếm phụ đề bị thiếu trên Internet dựa trên cấu hình thông tin chi tiết.", + "TaskDownloadMissingSubtitles": "Tải xuống phụ đề bị thiếu", + "TaskRefreshChannelsDescription": "Làm mới thông tin kênh internet.", + "TaskRefreshChannels": "Làm Mới Kênh", + "TaskCleanTranscodeDescription": "Xóa các tệp chuyển mã cũ hơn một ngày.", + "TaskCleanTranscode": "Làm Sạch Thư Mục Chuyển Mã", + "TaskUpdatePluginsDescription": "Tải xuống và cài đặt các bản cập nhật cho các plugin được định cấu hình để cập nhật tự động.", + "TaskUpdatePlugins": "Cập Nhật Plugins", + "TaskRefreshPeopleDescription": "Cập nhật thông tin chi tiết cho diễn viên và đạo diễn trong thư viện phương tiện của bạn.", + "TaskRefreshPeople": "Làm mới Người dùng", + "TaskCleanLogsDescription": "Xóa tập tin nhật ký cũ hơn {0} ngày.", + "TaskCleanLogs": "Làm sạch nhật ký", + "TaskRefreshLibraryDescription": "Quét thư viện phương tiện của bạn để tìm các tệp mới và làm mới thông tin chi tiết.", + "TaskRefreshLibrary": "Quét Thư viện Phương tiện", + "TaskRefreshChapterImagesDescription": "Tạo hình thu nhỏ cho các video có chương.", + "TaskRefreshChapterImages": "Trích xuất hình ảnh chương", + "TaskCleanCacheDescription": "Xóa các tệp cache không còn cần thiết của hệ thống.", + "TaskCleanCache": "Làm Sạch Thư Mục Cache", + "TasksChannelsCategory": "Kênh Internet", + "TasksApplicationCategory": "Ứng Dụng", + "TasksLibraryCategory": "Thư Viện", + "TasksMaintenanceCategory": "Bảo Trì", + "VersionNumber": "Phiên Bản {0}", + "ValueHasBeenAddedToLibrary": "{0} đã được thêm vào thư viện của bạn", + "UserStoppedPlayingItemWithValues": "{0} đã phát xong {1} trên {2}", + "UserStartedPlayingItemWithValues": "{0} đang phát {1} trên {2}", + "UserPolicyUpdatedWithName": "Chính sách người dùng đã được cập nhật cho {0}", + "UserPasswordChangedWithName": "Mật khẩu đã được thay đổi cho người dùng {0}", + "UserOnlineFromDevice": "{0} trực tuyến từ {1}", + "UserOfflineFromDevice": "{0} đã ngắt kết nối từ {1}", + "UserLockedOutWithName": "User {0} đã bị khóa", + "UserDownloadingItemWithValues": "{0} đang tải xuống {1}", + "UserDeletedWithName": "Người Dùng {0} đã được xóa", + "UserCreatedWithName": "Người Dùng {0} đã được tạo", + "User": "Người Dùng", + "TvShows": "Chương Trình TV", + "System": "Hệ Thống", + "SubtitleDownloadFailureFromForItem": "Không thể tải xuống phụ đề từ {0} cho {1}", + "StartupEmbyServerIsLoading": "Jellyfin Server đang tải. Vui lòng thử lại trong thời gian ngắn.", + "ServerNameNeedsToBeRestarted": "{0} cần được khởi động lại", + "ScheduledTaskStartedWithName": "{0} đã bắt đầu", + "ScheduledTaskFailedWithName": "{0} đã thất bại", + "ProviderValue": "Provider: {0}", + "PluginUpdatedWithName": "{0} đã cập nhật", + "PluginUninstalledWithName": "{0} đã được gỡ bỏ", + "PluginInstalledWithName": "{0} đã được cài đặt", + "Plugin": "Plugin", + "NotificationOptionVideoPlaybackStopped": "Phát lại video đã dừng", + "NotificationOptionVideoPlayback": "Đã bắt đầu phát lại video", + "NotificationOptionUserLockedOut": "Người dùng bị khóa", + "NotificationOptionTaskFailed": "Lỗi tác vụ đã lên lịch", + "NotificationOptionServerRestartRequired": "Yêu cầu khởi động lại Server", + "NotificationOptionPluginUpdateInstalled": "Cập nhật Plugin đã được cài đặt", + "NotificationOptionPluginUninstalled": "Đã gỡ bỏ Plugin", + "NotificationOptionPluginInstalled": "Đã cài đặt Plugin", + "NotificationOptionPluginError": "Thất bại Plugin", + "NotificationOptionNewLibraryContent": "Nội dung mới được thêm vào", + "NotificationOptionInstallationFailed": "Cài đặt thất bại", + "NotificationOptionCameraImageUploaded": "Đã tải lên hình ảnh máy ảnh", + "NotificationOptionAudioPlaybackStopped": "Phát lại âm thanh đã dừng", + "NotificationOptionAudioPlayback": "Phát lại âm thanh đã bắt đầu", + "NotificationOptionApplicationUpdateInstalled": "Bản cập nhật ứng dụng đã được cài đặt", + "NotificationOptionApplicationUpdateAvailable": "Bản cập nhật ứng dụng hiện sẵn có", + "NewVersionIsAvailable": "Một phiên bản mới của Jellyfin Server sẵn có để tải.", + "NameSeasonUnknown": "Không Rõ Mùa", + "NameSeasonNumber": "Mùa {0}", + "NameInstallFailed": "{0} cài đặt thất bại", + "MusicVideos": "Video Nhạc", + "Music": "Nhạc", + "MixedContent": "Nội dung hỗn hợp", + "MessageServerConfigurationUpdated": "Cấu hình máy chủ đã được cập nhật", + "MessageNamedServerConfigurationUpdatedWithValue": "Phần cấu hình máy chủ {0} đã được cập nhật", + "MessageApplicationUpdatedTo": "Jellyfin Server đã được cập nhật lên {0}", + "MessageApplicationUpdated": "Jellyfin Server đã được cập nhật", + "Latest": "Gần Nhất", + "LabelRunningTimeValue": "Thời Gian Chạy: {0}", + "LabelIpAddressValue": "Địa Chỉ IP: {0}", + "ItemRemovedWithName": "{0} đã xóa khỏi thư viện", + "ItemAddedWithName": "{0} được thêm vào thư viện", + "Inherit": "Thừa hưởng", + "HomeVideos": "Video nhà", + "HeaderRecordingGroups": "Nhóm Ghi Video", + "HeaderNextUp": "Tiếp Theo", + "HeaderFavoriteSongs": "Bài Hát Yêu Thích", + "HeaderFavoriteShows": "Chương Trình Yêu Thích", + "HeaderFavoriteEpisodes": "Tập Phim Yêu Thích", + "HeaderFavoriteArtists": "Nghệ Sĩ Yêu Thích", + "HeaderFavoriteAlbums": "Album Ưa Thích", + "HeaderCameraUploads": "Máy Ảnh Tải Lên", + "FailedLoginAttemptWithUserName": "Nỗ lực đăng nhập thất bại từ {0}", + "DeviceOnlineWithName": "{0} đã kết nối", + "DeviceOfflineWithName": "{0} đã ngắt kết nối", + "ChapterNameValue": "Chương {0}", + "Channels": "Kênh", + "CameraImageUploadedFrom": "Một hình ảnh máy ảnh mới đã được tải lên từ {0}", + "Books": "Sách", + "AuthenticationSucceededWithUserName": "{0} xác thực thành công", + "Application": "Ứng Dụng", + "AppDeviceValues": "Ứng Dụng: {0}, Thiết Bị: {1}" +} From 68d08e94fded259adc2b2cd3d9379d6ab1e8b384 Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Mon, 14 Sep 2020 16:18:39 +0100 Subject: [PATCH 34/46] Update Emby.Server.Implementations/ApplicationHost.cs Co-authored-by: Cody Robibero --- Emby.Server.Implementations/ApplicationHost.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 2206fabadf..878ea30fc7 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1041,7 +1041,7 @@ namespace Emby.Server.Implementations } /// - /// Returns a list of plugsin to install. + /// Returns a list of plugins to install. /// /// Path to check. /// True if an attempt should be made to delete old plugs. From cdf96d266317b2a16e8fcba2f18804f8a1b58bcb Mon Sep 17 00:00:00 2001 From: Android Dev Notes Date: Mon, 14 Sep 2020 21:30:20 +0530 Subject: [PATCH 35/46] Fix typos --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 55d6917ae0..5e731d2100 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,7 @@ To run the project with Visual Studio Code you will first need to open the repos Second, you need to [install the recommended extensions for the workspace](https://code.visualstudio.com/docs/editor/extension-gallery#_recommended-extensions). Note that extension recommendations are classified as either "Workspace Recommendations" or "Other Recommendations", but only the "Workspace Recommendations" are required. -After the required extensions are installed, you can can run the server by pressing `F5`. +After the required extensions are installed, you can run the server by pressing `F5`. #### Running From The Command Line From f73e744785fc8016e858c9f676ac0b04ee4f564b Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Mon, 14 Sep 2020 17:58:10 +0100 Subject: [PATCH 36/46] Update Emby.Server.Implementations/Plugins/PlugInManifest.cs Co-authored-by: dkanada --- Emby.Server.Implementations/Plugins/PlugInManifest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/Plugins/PlugInManifest.cs b/Emby.Server.Implementations/Plugins/PlugInManifest.cs index fa48d73c55..b874676d84 100644 --- a/Emby.Server.Implementations/Plugins/PlugInManifest.cs +++ b/Emby.Server.Implementations/Plugins/PlugInManifest.cs @@ -5,7 +5,7 @@ namespace Emby.Server.Implementations.Plugins /// /// Defines a Plugin manifest file. /// - public class PlugInManifest + public class PluginManifest { /// /// Gets or sets the category of the plugin. From a626ce5bd00ad1076ea704673ecd38d270938264 Mon Sep 17 00:00:00 2001 From: hoanghuy309 Date: Mon, 14 Sep 2020 14:10:44 +0000 Subject: [PATCH 37/46] Translated using Weblate (Vietnamese) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/vi/ --- Emby.Server.Implementations/Localization/Core/vi.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Emby.Server.Implementations/Localization/Core/vi.json b/Emby.Server.Implementations/Localization/Core/vi.json index 8b4334d7a6..bf4cfe75ca 100644 --- a/Emby.Server.Implementations/Localization/Core/vi.json +++ b/Emby.Server.Implementations/Localization/Core/vi.json @@ -4,7 +4,7 @@ "Folders": "Thư Mục", "Genres": "Thể Loại", "HeaderAlbumArtists": "Bộ Sưu Tập Nghệ sĩ", - "HeaderContinueWatching": "Tiếp Tục Xem", + "HeaderContinueWatching": "Tiếp Tục Xem Tiếp", "HeaderLiveTV": "TV Trực Tiếp", "Movies": "Phim", "Photos": "Ảnh", @@ -14,7 +14,7 @@ "Sync": "Đồng Bộ", "ValueSpecialEpisodeName": "Đặc Biệt - {0}", "Albums": "Bộ Sưu Tập", - "Artists": "Nghệ Sĩ", + "Artists": "Các Nghệ Sĩ", "TaskDownloadMissingSubtitlesDescription": "Tìm kiếm phụ đề bị thiếu trên Internet dựa trên cấu hình thông tin chi tiết.", "TaskDownloadMissingSubtitles": "Tải xuống phụ đề bị thiếu", "TaskRefreshChannelsDescription": "Làm mới thông tin kênh internet.", @@ -108,9 +108,9 @@ "DeviceOnlineWithName": "{0} đã kết nối", "DeviceOfflineWithName": "{0} đã ngắt kết nối", "ChapterNameValue": "Chương {0}", - "Channels": "Kênh", + "Channels": "Các Kênh", "CameraImageUploadedFrom": "Một hình ảnh máy ảnh mới đã được tải lên từ {0}", - "Books": "Sách", + "Books": "Các Quyển Sách", "AuthenticationSucceededWithUserName": "{0} xác thực thành công", "Application": "Ứng Dụng", "AppDeviceValues": "Ứng Dụng: {0}, Thiết Bị: {1}" From d27d2a8990afb80ba137688121f85b831599d45a Mon Sep 17 00:00:00 2001 From: Jim Cartlidge Date: Mon, 14 Sep 2020 18:23:50 +0100 Subject: [PATCH 38/46] Renamed file. --- .../ApplicationHost.cs | 35 ++++++++++++------- .../Plugins/PlugInManifest.cs | 20 +++++------ 2 files changed, 33 insertions(+), 22 deletions(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 878ea30fc7..d1e28cce5c 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1051,27 +1051,38 @@ namespace Emby.Server.Implementations var dllList = new List(); var versions = new List<(Version PluginVersion, string Name, string Path)>(); var directories = Directory.EnumerateDirectories(path, "*.*", SearchOption.TopDirectoryOnly); + string metafile; foreach (var dir in directories) { try { - var manifest = _jsonSerializer.DeserializeFromFile(Path.Combine(dir, "meta.json")); - - if (!Version.TryParse(manifest.TargetAbi, out var targetAbi)) + metafile = Path.Combine(dir, "meta.json"); + if (File.Exists(metafile)) { - targetAbi = new Version(0, 0, 0, 1); - } + var manifest = _jsonSerializer.DeserializeFromFile(metafile); - if (!Version.TryParse(manifest.Version, out var version)) - { - version = new Version(0, 0, 0, 1); - } + if (!Version.TryParse(manifest.TargetAbi, out var targetAbi)) + { + targetAbi = new Version(0, 0, 0, 1); + } - if (targetAbi >= ApplicationVersion) + if (!Version.TryParse(manifest.Version, out var version)) + { + version = new Version(0, 0, 0, 1); + } + + if (ApplicationVersion <= targetAbi) + { + // Only load Plugins if the plugin is built for this version or below. + versions.Add((version, manifest.Name, dir)); + } + } + else { - // Only load Plugins for this version or below. - versions.Add((version, manifest.Name, dir)); + metafile = dir.Split(new char[] { Path.DirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries).Last(); + // Add it under the path name and version 0.0.0.1. + versions.Add((new Version("0.0.0.1"), metafile, dir)); } } catch diff --git a/Emby.Server.Implementations/Plugins/PlugInManifest.cs b/Emby.Server.Implementations/Plugins/PlugInManifest.cs index b874676d84..33762791bc 100644 --- a/Emby.Server.Implementations/Plugins/PlugInManifest.cs +++ b/Emby.Server.Implementations/Plugins/PlugInManifest.cs @@ -9,52 +9,52 @@ namespace Emby.Server.Implementations.Plugins { /// /// Gets or sets the category of the plugin. - /// + /// public string Category { get; set; } /// /// Gets or sets the changelog information. - /// + /// public string Changelog { get; set; } /// /// Gets or sets the description of the plugin. - /// + /// public string Description { get; set; } /// /// Gets or sets the Global Unique Identifier for the plugin. - /// + /// public Guid Guid { get; set; } /// /// Gets or sets the Name of the plugin. - /// + /// public string Name { get; set; } /// /// Gets or sets an overview of the plugin. - /// + /// public string Overview { get; set; } /// /// Gets or sets the owner of the plugin. - /// + /// public string Owner { get; set; } /// /// Gets or sets the compatibility version for the plugin. - /// + /// public string TargetAbi { get; set; } /// /// Gets or sets the timestamp of the plugin. - /// + /// public DateTime Timestamp { get; set; } /// /// Gets or sets the Version number of the plugin. - /// + /// public string Version { get; set; } } } From f80e181eda2d1bb9348bb2b7e050e51d9948cb41 Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Mon, 14 Sep 2020 18:44:17 +0100 Subject: [PATCH 39/46] Update Emby.Server.Implementations/ApplicationHost.cs Co-authored-by: Cody Robibero --- Emby.Server.Implementations/ApplicationHost.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index d1e28cce5c..4cb107f804 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1080,7 +1080,7 @@ namespace Emby.Server.Implementations } else { - metafile = dir.Split(new char[] { Path.DirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries).Last(); + metafile = dir.Split(new[] { Path.DirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries)[^1]; // Add it under the path name and version 0.0.0.1. versions.Add((new Version("0.0.0.1"), metafile, dir)); } From e88d3ba8c2fd502ee159c0554467e9af064dfd1c Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Mon, 14 Sep 2020 18:44:29 +0100 Subject: [PATCH 40/46] Update Emby.Server.Implementations/ApplicationHost.cs Co-authored-by: Cody Robibero --- Emby.Server.Implementations/ApplicationHost.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 4cb107f804..8eed609d42 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1082,7 +1082,7 @@ namespace Emby.Server.Implementations { metafile = dir.Split(new[] { Path.DirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries)[^1]; // Add it under the path name and version 0.0.0.1. - versions.Add((new Version("0.0.0.1"), metafile, dir)); + versions.Add(new Version(0, 0, 0, 1), metafile, dir)); } } catch From 51c416c83250988a20c2bd1c21a9fa4d528437a3 Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Mon, 14 Sep 2020 20:23:35 +0100 Subject: [PATCH 41/46] Update Emby.Server.Implementations/ApplicationHost.cs Co-authored-by: Cody Robibero --- Emby.Server.Implementations/ApplicationHost.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 8eed609d42..b9e2f5b672 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1072,7 +1072,7 @@ namespace Emby.Server.Implementations version = new Version(0, 0, 0, 1); } - if (ApplicationVersion <= targetAbi) + if (ApplicationVersion >= targetAbi) { // Only load Plugins if the plugin is built for this version or below. versions.Add((version, manifest.Name, dir)); From 69c4b44d248367fb45019242ab95d68ef0eff7e3 Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Mon, 14 Sep 2020 20:52:18 +0100 Subject: [PATCH 42/46] Update ApplicationHost.cs --- Emby.Server.Implementations/ApplicationHost.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index b9e2f5b672..3dce001c7d 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1080,7 +1080,7 @@ namespace Emby.Server.Implementations } else { - metafile = dir.Split(new[] { Path.DirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries)[^1]; + metafile = dir.Split(new[] { Path.DirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries)[^1]); // Add it under the path name and version 0.0.0.1. versions.Add(new Version(0, 0, 0, 1), metafile, dir)); } From 02951bb8ce19f5487f2960c3a71fb23f870f9f9a Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Mon, 14 Sep 2020 20:57:00 +0100 Subject: [PATCH 43/46] Update Emby.Server.Implementations/ApplicationHost.cs Co-authored-by: h1dden-da3m0n <33120068+h1dden-da3m0n@users.noreply.github.com> --- Emby.Server.Implementations/ApplicationHost.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 3dce001c7d..c4447770fb 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1082,7 +1082,7 @@ namespace Emby.Server.Implementations { metafile = dir.Split(new[] { Path.DirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries)[^1]); // Add it under the path name and version 0.0.0.1. - versions.Add(new Version(0, 0, 0, 1), metafile, dir)); + versions.Add(new Version(0, 0, 0, 1), metafile, dir); } } catch From 5baf87663f80a2e4f899b596d6f14aaa2f01687b Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Mon, 14 Sep 2020 20:57:49 +0100 Subject: [PATCH 44/46] Update Emby.Server.Implementations/ApplicationHost.cs Co-authored-by: h1dden-da3m0n <33120068+h1dden-da3m0n@users.noreply.github.com> --- Emby.Server.Implementations/ApplicationHost.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index c4447770fb..d4d3a1d3b6 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1080,7 +1080,7 @@ namespace Emby.Server.Implementations } else { - metafile = dir.Split(new[] { Path.DirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries)[^1]); + metafile = dir.Split(new[] { Path.DirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries)[^1]; // Add it under the path name and version 0.0.0.1. versions.Add(new Version(0, 0, 0, 1), metafile, dir); } From a2c50e8005280887ad744739469cd64df13bfabb Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Mon, 14 Sep 2020 21:02:13 +0100 Subject: [PATCH 45/46] Update Emby.Server.Implementations/ApplicationHost.cs Co-authored-by: h1dden-da3m0n <33120068+h1dden-da3m0n@users.noreply.github.com> --- Emby.Server.Implementations/ApplicationHost.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index d4d3a1d3b6..83617111b1 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1082,7 +1082,7 @@ namespace Emby.Server.Implementations { metafile = dir.Split(new[] { Path.DirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries)[^1]; // Add it under the path name and version 0.0.0.1. - versions.Add(new Version(0, 0, 0, 1), metafile, dir); + versions.Add((new Version(0, 0, 0, 1), metafile, dir)); } } catch From ad00b93be54115674750b1b89421f9e5ea1807cb Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Wed, 16 Sep 2020 14:14:10 +0100 Subject: [PATCH 46/46] Rename PlugInManifest.cs to PluginManifest.cs --- .../Plugins/{PlugInManifest.cs => PluginManifest.cs} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Emby.Server.Implementations/Plugins/{PlugInManifest.cs => PluginManifest.cs} (100%) diff --git a/Emby.Server.Implementations/Plugins/PlugInManifest.cs b/Emby.Server.Implementations/Plugins/PluginManifest.cs similarity index 100% rename from Emby.Server.Implementations/Plugins/PlugInManifest.cs rename to Emby.Server.Implementations/Plugins/PluginManifest.cs