add smb fixes

This commit is contained in:
Luke Pulverenti 2017-05-10 15:12:03 -04:00
parent e9ea1d4ce2
commit 369df3ffda
14 changed files with 26 additions and 15 deletions

View File

@ -53,6 +53,11 @@ namespace Emby.Common.Implementations.IO
if (separator == '/') if (separator == '/')
{ {
result = result.Replace('\\', '/'); result = result.Replace('\\', '/');
if (result.StartsWith("smb:/", StringComparison.OrdinalIgnoreCase) && !result.StartsWith("smb://", StringComparison.OrdinalIgnoreCase))
{
result = result.Replace("smb:/", "smb://");
}
} }
return result; return result;

View File

@ -761,7 +761,10 @@ namespace Emby.Server.Core
return null; 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; //localCert.PrivateKey = PrivateKey.CreateFromFile(pvk_file).RSA;
if (!localCert.HasPrivateKey) if (!localCert.HasPrivateKey)
{ {

View File

@ -126,7 +126,7 @@ namespace Emby.Server.Implementations.AppBase
Logger.Info("Saving system configuration"); Logger.Info("Saving system configuration");
var path = CommonApplicationPaths.SystemConfigurationFilePath; var path = CommonApplicationPaths.SystemConfigurationFilePath;
FileSystem.CreateDirectory(Path.GetDirectoryName(path)); FileSystem.CreateDirectory(FileSystem.GetDirectoryName(path));
lock (_configurationSyncLock) lock (_configurationSyncLock)
{ {
@ -293,7 +293,7 @@ namespace Emby.Server.Implementations.AppBase
_configurations.AddOrUpdate(key, configuration, (k, v) => configuration); _configurations.AddOrUpdate(key, configuration, (k, v) => configuration);
var path = GetConfigurationFile(key); var path = GetConfigurationFile(key);
FileSystem.CreateDirectory(Path.GetDirectoryName(path)); FileSystem.CreateDirectory(FileSystem.GetDirectoryName(path));
lock (_configurationSyncLock) lock (_configurationSyncLock)
{ {

View File

@ -47,7 +47,7 @@ namespace Emby.Server.Implementations.AppBase
// If the file didn't exist before, or if something has changed, re-save // If the file didn't exist before, or if something has changed, re-save
if (buffer == null || !buffer.SequenceEqual(newBytes)) 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 // Save it after load in case we got new items
fileSystem.WriteAllBytes(path, newBytes); fileSystem.WriteAllBytes(path, newBytes);

View File

@ -158,7 +158,7 @@ namespace Emby.Server.Implementations.Devices
_libraryMonitor.ReportFileSystemChangeBeginning(path); _libraryMonitor.ReportFileSystemChangeBeginning(path);
_fileSystem.CreateDirectory(Path.GetDirectoryName(path)); _fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path));
try try
{ {

View File

@ -46,7 +46,7 @@ namespace Emby.Server.Implementations.Devices
public Task SaveDevice(DeviceInfo device) public Task SaveDevice(DeviceInfo device)
{ {
var path = Path.Combine(GetDevicePath(device.Id), "device.json"); var path = Path.Combine(GetDevicePath(device.Id), "device.json");
_fileSystem.CreateDirectory(Path.GetDirectoryName(path)); _fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path));
lock (_syncLock) lock (_syncLock)
{ {
@ -180,7 +180,7 @@ namespace Emby.Server.Implementations.Devices
public void AddCameraUpload(string deviceId, LocalFileInfo file) public void AddCameraUpload(string deviceId, LocalFileInfo file)
{ {
var path = Path.Combine(GetDevicePath(deviceId), "camerauploads.json"); var path = Path.Combine(GetDevicePath(deviceId), "camerauploads.json");
_fileSystem.CreateDirectory(Path.GetDirectoryName(path)); _fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path));
lock (_syncLock) lock (_syncLock)
{ {

View File

@ -97,7 +97,7 @@ namespace Emby.Server.Implementations.FFMpeg
else else
{ {
info = existingVersion; info = existingVersion;
versionedDirectoryPath = Path.GetDirectoryName(info.EncoderPath); versionedDirectoryPath = _fileSystem.GetDirectoryName(info.EncoderPath);
excludeFromDeletions.Add(versionedDirectoryPath); excludeFromDeletions.Add(versionedDirectoryPath);
} }
} }
@ -135,7 +135,7 @@ namespace Emby.Server.Implementations.FFMpeg
{ {
EncoderPath = encoder, EncoderPath = encoder,
ProbePath = probe, ProbePath = probe,
Version = Path.GetFileName(Path.GetDirectoryName(probe)) Version = Path.GetFileName(_fileSystem.GetDirectoryName(probe))
}; };
} }
} }

View File

@ -1197,6 +1197,7 @@ namespace Emby.Server.Implementations.Library
catch (OperationCanceledException) catch (OperationCanceledException)
{ {
_logger.Info("Post-scan task cancelled: {0}", task.GetType().Name); _logger.Info("Post-scan task cancelled: {0}", task.GetType().Name);
throw;
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@ -63,7 +63,7 @@ namespace Emby.Server.Implementations.Library.Validators
catch (OperationCanceledException) catch (OperationCanceledException)
{ {
// Don't clutter the log // Don't clutter the log
break; throw;
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@ -53,7 +53,7 @@ namespace Emby.Server.Implementations.Library.Validators
catch (OperationCanceledException) catch (OperationCanceledException)
{ {
// Don't clutter the log // Don't clutter the log
break; throw;
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@ -54,7 +54,7 @@ namespace Emby.Server.Implementations.Library.Validators
catch (OperationCanceledException) catch (OperationCanceledException)
{ {
// Don't clutter the log // Don't clutter the log
break; throw;
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@ -54,7 +54,7 @@ namespace Emby.Server.Implementations.Library.Validators
catch (OperationCanceledException) catch (OperationCanceledException)
{ {
// Don't clutter the log // Don't clutter the log
break; throw;
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@ -53,7 +53,7 @@ namespace Emby.Server.Implementations.Library.Validators
catch (OperationCanceledException) catch (OperationCanceledException)
{ {
// Don't clutter the log // Don't clutter the log
break; throw;
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@ -26,6 +26,8 @@ namespace Emby.Server.Implementations.Library.Validators
while (yearNumber < maxYear) while (yearNumber < maxYear)
{ {
cancellationToken.ThrowIfCancellationRequested();
try try
{ {
var year = _libraryManager.GetYear(yearNumber); var year = _libraryManager.GetYear(yearNumber);
@ -35,7 +37,7 @@ namespace Emby.Server.Implementations.Library.Validators
catch (OperationCanceledException) catch (OperationCanceledException)
{ {
// Don't clutter the log // Don't clutter the log
break; throw;
} }
catch (Exception ex) catch (Exception ex)
{ {