diff --git a/Emby.Common.Implementations/IO/SharpCifsFileSystem.cs b/Emby.Common.Implementations/IO/SharpCifsFileSystem.cs index 0a407d64f5..283bcdef05 100644 --- a/Emby.Common.Implementations/IO/SharpCifsFileSystem.cs +++ b/Emby.Common.Implementations/IO/SharpCifsFileSystem.cs @@ -53,6 +53,11 @@ public string GetDirectoryName(string path) if (separator == '/') { result = result.Replace('\\', '/'); + + if (result.StartsWith("smb:/", StringComparison.OrdinalIgnoreCase) && !result.StartsWith("smb://", StringComparison.OrdinalIgnoreCase)) + { + result = result.Replace("smb:/", "smb://"); + } } return result; diff --git a/Emby.Server.Core/ApplicationHost.cs b/Emby.Server.Core/ApplicationHost.cs index 6a3881caf8..5ceef0754e 100644 --- a/Emby.Server.Core/ApplicationHost.cs +++ b/Emby.Server.Core/ApplicationHost.cs @@ -761,7 +761,10 @@ private ICertificate GetCertificate(CertificateInfo info) return null; } - X509Certificate2 localCert = new X509Certificate2(certificateLocation, info.Password); + // Don't use an empty string password + var password = string.IsNullOrWhiteSpace(info.Password) ? null : info.Password; + + X509Certificate2 localCert = new X509Certificate2(certificateLocation, password); //localCert.PrivateKey = PrivateKey.CreateFromFile(pvk_file).RSA; if (!localCert.HasPrivateKey) { diff --git a/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs b/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs index 13874223cc..385b4bd518 100644 --- a/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs +++ b/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs @@ -126,7 +126,7 @@ public void SaveConfiguration() Logger.Info("Saving system configuration"); var path = CommonApplicationPaths.SystemConfigurationFilePath; - FileSystem.CreateDirectory(Path.GetDirectoryName(path)); + FileSystem.CreateDirectory(FileSystem.GetDirectoryName(path)); lock (_configurationSyncLock) { @@ -293,7 +293,7 @@ public void SaveConfiguration(string key, object configuration) _configurations.AddOrUpdate(key, configuration, (k, v) => configuration); var path = GetConfigurationFile(key); - FileSystem.CreateDirectory(Path.GetDirectoryName(path)); + FileSystem.CreateDirectory(FileSystem.GetDirectoryName(path)); lock (_configurationSyncLock) { diff --git a/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs b/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs index ad2f459459..d6a41dd67b 100644 --- a/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs +++ b/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs @@ -47,7 +47,7 @@ public static object GetXmlConfiguration(Type type, string path, IXmlSerializer // If the file didn't exist before, or if something has changed, re-save if (buffer == null || !buffer.SequenceEqual(newBytes)) { - fileSystem.CreateDirectory(Path.GetDirectoryName(path)); + fileSystem.CreateDirectory(fileSystem.GetDirectoryName(path)); // Save it after load in case we got new items fileSystem.WriteAllBytes(path, newBytes); diff --git a/Emby.Server.Implementations/Devices/DeviceManager.cs b/Emby.Server.Implementations/Devices/DeviceManager.cs index 588b42a093..b246ef1962 100644 --- a/Emby.Server.Implementations/Devices/DeviceManager.cs +++ b/Emby.Server.Implementations/Devices/DeviceManager.cs @@ -158,7 +158,7 @@ public async Task AcceptCameraUpload(string deviceId, Stream stream, LocalFileIn _libraryMonitor.ReportFileSystemChangeBeginning(path); - _fileSystem.CreateDirectory(Path.GetDirectoryName(path)); + _fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path)); try { diff --git a/Emby.Server.Implementations/Devices/DeviceRepository.cs b/Emby.Server.Implementations/Devices/DeviceRepository.cs index f739765b34..de0dfda2ed 100644 --- a/Emby.Server.Implementations/Devices/DeviceRepository.cs +++ b/Emby.Server.Implementations/Devices/DeviceRepository.cs @@ -46,7 +46,7 @@ private string GetDevicePath(string id) public Task SaveDevice(DeviceInfo device) { var path = Path.Combine(GetDevicePath(device.Id), "device.json"); - _fileSystem.CreateDirectory(Path.GetDirectoryName(path)); + _fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path)); lock (_syncLock) { @@ -180,7 +180,7 @@ public ContentUploadHistory GetCameraUploadHistory(string deviceId) public void AddCameraUpload(string deviceId, LocalFileInfo file) { var path = Path.Combine(GetDevicePath(deviceId), "camerauploads.json"); - _fileSystem.CreateDirectory(Path.GetDirectoryName(path)); + _fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path)); lock (_syncLock) { diff --git a/Emby.Server.Implementations/FFMpeg/FFMpegLoader.cs b/Emby.Server.Implementations/FFMpeg/FFMpegLoader.cs index 2becebb3d3..3c8ad55fe4 100644 --- a/Emby.Server.Implementations/FFMpeg/FFMpegLoader.cs +++ b/Emby.Server.Implementations/FFMpeg/FFMpegLoader.cs @@ -97,7 +97,7 @@ public async Task GetFFMpegInfo(StartupOptions options, IProgress progress, CancellationToke catch (OperationCanceledException) { _logger.Info("Post-scan task cancelled: {0}", task.GetType().Name); + throw; } catch (Exception ex) { diff --git a/Emby.Server.Implementations/Library/Validators/ArtistsValidator.cs b/Emby.Server.Implementations/Library/Validators/ArtistsValidator.cs index 643c5970e1..d4be2dabed 100644 --- a/Emby.Server.Implementations/Library/Validators/ArtistsValidator.cs +++ b/Emby.Server.Implementations/Library/Validators/ArtistsValidator.cs @@ -63,7 +63,7 @@ public async Task Run(IProgress progress, CancellationToken cancellation catch (OperationCanceledException) { // Don't clutter the log - break; + throw; } catch (Exception ex) { diff --git a/Emby.Server.Implementations/Library/Validators/GameGenresValidator.cs b/Emby.Server.Implementations/Library/Validators/GameGenresValidator.cs index b1820bb917..f7fbb93318 100644 --- a/Emby.Server.Implementations/Library/Validators/GameGenresValidator.cs +++ b/Emby.Server.Implementations/Library/Validators/GameGenresValidator.cs @@ -53,7 +53,7 @@ public async Task Run(IProgress progress, CancellationToken cancellation catch (OperationCanceledException) { // Don't clutter the log - break; + throw; } catch (Exception ex) { diff --git a/Emby.Server.Implementations/Library/Validators/GenresValidator.cs b/Emby.Server.Implementations/Library/Validators/GenresValidator.cs index d8956f78a1..d71e77a9a7 100644 --- a/Emby.Server.Implementations/Library/Validators/GenresValidator.cs +++ b/Emby.Server.Implementations/Library/Validators/GenresValidator.cs @@ -54,7 +54,7 @@ public async Task Run(IProgress progress, CancellationToken cancellation catch (OperationCanceledException) { // Don't clutter the log - break; + throw; } catch (Exception ex) { diff --git a/Emby.Server.Implementations/Library/Validators/MusicGenresValidator.cs b/Emby.Server.Implementations/Library/Validators/MusicGenresValidator.cs index 983c881b75..98d53c1250 100644 --- a/Emby.Server.Implementations/Library/Validators/MusicGenresValidator.cs +++ b/Emby.Server.Implementations/Library/Validators/MusicGenresValidator.cs @@ -54,7 +54,7 @@ public async Task Run(IProgress progress, CancellationToken cancellation catch (OperationCanceledException) { // Don't clutter the log - break; + throw; } catch (Exception ex) { diff --git a/Emby.Server.Implementations/Library/Validators/StudiosValidator.cs b/Emby.Server.Implementations/Library/Validators/StudiosValidator.cs index 6faab7bb9d..97b8ff0ac4 100644 --- a/Emby.Server.Implementations/Library/Validators/StudiosValidator.cs +++ b/Emby.Server.Implementations/Library/Validators/StudiosValidator.cs @@ -53,7 +53,7 @@ public async Task Run(IProgress progress, CancellationToken cancellation catch (OperationCanceledException) { // Don't clutter the log - break; + throw; } catch (Exception ex) { diff --git a/Emby.Server.Implementations/Library/Validators/YearsPostScanTask.cs b/Emby.Server.Implementations/Library/Validators/YearsPostScanTask.cs index ae43c77f0a..4afb4c04a7 100644 --- a/Emby.Server.Implementations/Library/Validators/YearsPostScanTask.cs +++ b/Emby.Server.Implementations/Library/Validators/YearsPostScanTask.cs @@ -26,6 +26,8 @@ public async Task Run(IProgress progress, CancellationToken cancellation while (yearNumber < maxYear) { + cancellationToken.ThrowIfCancellationRequested(); + try { var year = _libraryManager.GetYear(yearNumber); @@ -35,7 +37,7 @@ public async Task Run(IProgress progress, CancellationToken cancellation catch (OperationCanceledException) { // Don't clutter the log - break; + throw; } catch (Exception ex) { diff --git a/ThirdParty/emby/Emby.Common.Implementations.dll b/ThirdParty/emby/Emby.Common.Implementations.dll index 3721a778fd..0a054bb74c 100644 Binary files a/ThirdParty/emby/Emby.Common.Implementations.dll and b/ThirdParty/emby/Emby.Common.Implementations.dll differ diff --git a/ThirdParty/emby/Emby.Server.Core.dll b/ThirdParty/emby/Emby.Server.Core.dll index 12d7edf331..74a2f1a441 100644 Binary files a/ThirdParty/emby/Emby.Server.Core.dll and b/ThirdParty/emby/Emby.Server.Core.dll differ