diff --git a/Emby.Common.Implementations/Cryptography/CryptographyProvider.cs b/Emby.Common.Implementations/Cryptography/CryptographyProvider.cs index e5e4b1c7c1..7b8d95b96c 100644 --- a/Emby.Common.Implementations/Cryptography/CryptographyProvider.cs +++ b/Emby.Common.Implementations/Cryptography/CryptographyProvider.cs @@ -35,5 +35,13 @@ namespace Emby.Common.Implementations.Cryptography return provider.ComputeHash(str); } } + + public byte[] GetMD5Bytes(byte[] bytes) + { + using (var provider = MD5.Create()) + { + return provider.ComputeHash(bytes); + } + } } } diff --git a/MediaBrowser.Server.Implementations/Reflection/AssemblyInfo.cs b/Emby.Common.Implementations/Reflection/AssemblyInfo.cs similarity index 63% rename from MediaBrowser.Server.Implementations/Reflection/AssemblyInfo.cs rename to Emby.Common.Implementations/Reflection/AssemblyInfo.cs index ec25e7951e..820856da5f 100644 --- a/MediaBrowser.Server.Implementations/Reflection/AssemblyInfo.cs +++ b/Emby.Common.Implementations/Reflection/AssemblyInfo.cs @@ -1,14 +1,18 @@ using System; using System.IO; using MediaBrowser.Model.Reflection; +using System.Reflection; -namespace MediaBrowser.Server.Implementations.Reflection +namespace Emby.Common.Implementations.Reflection { public class AssemblyInfo : IAssemblyInfo { public Stream GetManifestResourceStream(Type type, string resource) { +#if NET46 return type.Assembly.GetManifestResourceStream(resource); +#endif + return type.GetTypeInfo().Assembly.GetManifestResourceStream(resource); } } } diff --git a/MediaBrowser.Server.Implementations/TextEncoding/TextEncoding.cs b/Emby.Common.Implementations/TextEncoding/TextEncoding.cs similarity index 88% rename from MediaBrowser.Server.Implementations/TextEncoding/TextEncoding.cs rename to Emby.Common.Implementations/TextEncoding/TextEncoding.cs index 4c047b7d5e..35b869e43b 100644 --- a/MediaBrowser.Server.Implementations/TextEncoding/TextEncoding.cs +++ b/Emby.Common.Implementations/TextEncoding/TextEncoding.cs @@ -2,7 +2,7 @@ using MediaBrowser.Model.IO; using MediaBrowser.Model.TextEncoding; -namespace MediaBrowser.Server.Implementations.TextEncoding +namespace Emby.Common.Implementations.TextEncoding { public class TextEncoding : IEncoding { @@ -42,8 +42,7 @@ namespace MediaBrowser.Server.Implementations.TextEncoding if (buffer[0] == 0x2b && buffer[1] == 0x2f && buffer[2] == 0x76) return Encoding.UTF7; - // It's ok - anything aside from utf is ok since that's what we're looking for - return Encoding.Default; + return null; } } } diff --git a/MediaBrowser.Server.Implementations/Xml/XmlReaderSettingsFactory.cs b/Emby.Common.Implementations/Xml/XmlReaderSettingsFactory.cs similarity index 87% rename from MediaBrowser.Server.Implementations/Xml/XmlReaderSettingsFactory.cs rename to Emby.Common.Implementations/Xml/XmlReaderSettingsFactory.cs index ae7018ad44..806290cf44 100644 --- a/MediaBrowser.Server.Implementations/Xml/XmlReaderSettingsFactory.cs +++ b/Emby.Common.Implementations/Xml/XmlReaderSettingsFactory.cs @@ -1,7 +1,7 @@ using System.Xml; using MediaBrowser.Model.Xml; -namespace MediaBrowser.Server.Implementations.Xml +namespace Emby.Common.Implementations.Xml { public class XmlReaderSettingsFactory : IXmlReaderSettingsFactory { @@ -11,7 +11,9 @@ namespace MediaBrowser.Server.Implementations.Xml if (!enableValidation) { +#if NET46 settings.ValidationType = ValidationType.None; +#endif } return settings; diff --git a/Emby.Server.Implementations/Emby.Server.Implementations.csproj b/Emby.Server.Implementations/Emby.Server.Implementations.csproj index e3d4046442..152a165e21 100644 --- a/Emby.Server.Implementations/Emby.Server.Implementations.csproj +++ b/Emby.Server.Implementations/Emby.Server.Implementations.csproj @@ -69,6 +69,7 @@ + @@ -161,14 +162,28 @@ + + + + + + + + + + + + + + + + - - - + {9142eefa-7570-41e1-bfcc-468bb571af2f} diff --git a/MediaBrowser.Server.Implementations/IO/ThrottledStream.cs b/Emby.Server.Implementations/IO/ThrottledStream.cs similarity index 98% rename from MediaBrowser.Server.Implementations/IO/ThrottledStream.cs rename to Emby.Server.Implementations/IO/ThrottledStream.cs index 538812dc0b..81760b6397 100644 --- a/MediaBrowser.Server.Implementations/IO/ThrottledStream.cs +++ b/Emby.Server.Implementations/IO/ThrottledStream.cs @@ -3,7 +3,7 @@ using System.IO; using System.Threading; using System.Threading.Tasks; -namespace MediaBrowser.Server.Implementations.IO +namespace Emby.Server.Implementations.IO { /// /// Class for streaming data with throttling support. @@ -326,9 +326,10 @@ namespace MediaBrowser.Server.Implementations.IO try { // The time to sleep is more then a millisecond, so sleep. - Thread.Sleep(toSleep); + var task = Task.Delay(toSleep); + Task.WaitAll(task); } - catch (ThreadAbortException) + catch { // Eatup ThreadAbortException. } diff --git a/MediaBrowser.Server.Implementations/Sync/AppSyncProvider.cs b/Emby.Server.Implementations/Sync/AppSyncProvider.cs similarity index 98% rename from MediaBrowser.Server.Implementations/Sync/AppSyncProvider.cs rename to Emby.Server.Implementations/Sync/AppSyncProvider.cs index 408ec717eb..d405a0ff94 100644 --- a/MediaBrowser.Server.Implementations/Sync/AppSyncProvider.cs +++ b/Emby.Server.Implementations/Sync/AppSyncProvider.cs @@ -7,7 +7,7 @@ using System; using System.Collections.Generic; using System.Linq; -namespace MediaBrowser.Server.Implementations.Sync +namespace Emby.Server.Implementations.Sync { public class AppSyncProvider : ISyncProvider, IHasUniqueTargetIds, IHasSyncQuality, IHasDuplicateCheck { diff --git a/MediaBrowser.Server.Implementations/Sync/CloudSyncProfile.cs b/Emby.Server.Implementations/Sync/CloudSyncProfile.cs similarity index 99% rename from MediaBrowser.Server.Implementations/Sync/CloudSyncProfile.cs rename to Emby.Server.Implementations/Sync/CloudSyncProfile.cs index f40b644989..1a78c8ae66 100644 --- a/MediaBrowser.Server.Implementations/Sync/CloudSyncProfile.cs +++ b/Emby.Server.Implementations/Sync/CloudSyncProfile.cs @@ -1,7 +1,7 @@ using MediaBrowser.Model.Dlna; using System.Collections.Generic; -namespace MediaBrowser.Server.Implementations.Sync +namespace Emby.Server.Implementations.Sync { public class CloudSyncProfile : DeviceProfile { diff --git a/MediaBrowser.Server.Implementations/Sync/IHasSyncQuality.cs b/Emby.Server.Implementations/Sync/IHasSyncQuality.cs similarity index 95% rename from MediaBrowser.Server.Implementations/Sync/IHasSyncQuality.cs rename to Emby.Server.Implementations/Sync/IHasSyncQuality.cs index e7eee09232..bec8b37a77 100644 --- a/MediaBrowser.Server.Implementations/Sync/IHasSyncQuality.cs +++ b/Emby.Server.Implementations/Sync/IHasSyncQuality.cs @@ -1,7 +1,7 @@ using MediaBrowser.Model.Sync; using System.Collections.Generic; -namespace MediaBrowser.Server.Implementations.Sync +namespace Emby.Server.Implementations.Sync { public interface IHasSyncQuality { diff --git a/MediaBrowser.Server.Implementations/Sync/MediaSync.cs b/Emby.Server.Implementations/Sync/MediaSync.cs similarity index 97% rename from MediaBrowser.Server.Implementations/Sync/MediaSync.cs rename to Emby.Server.Implementations/Sync/MediaSync.cs index b6853267ea..b420a3df43 100644 --- a/MediaBrowser.Server.Implementations/Sync/MediaSync.cs +++ b/Emby.Server.Implementations/Sync/MediaSync.cs @@ -13,15 +13,14 @@ using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; -using System.Security.Cryptography; using System.Text; using System.Threading; using System.Threading.Tasks; +using Emby.Server.Implementations.IO; +using MediaBrowser.Model.Cryptography; using MediaBrowser.Model.IO; -using MediaBrowser.Common.IO; -using MediaBrowser.Server.Implementations.IO; -namespace MediaBrowser.Server.Implementations.Sync +namespace Emby.Server.Implementations.Sync { public class MediaSync { @@ -30,17 +29,19 @@ namespace MediaBrowser.Server.Implementations.Sync private readonly ILogger _logger; private readonly IFileSystem _fileSystem; private readonly IConfigurationManager _config; + private readonly ICryptographyProvider _cryptographyProvider; public const string PathSeparatorString = "/"; public const char PathSeparatorChar = '/'; - public MediaSync(ILogger logger, ISyncManager syncManager, IServerApplicationHost appHost, IFileSystem fileSystem, IConfigurationManager config) + public MediaSync(ILogger logger, ISyncManager syncManager, IServerApplicationHost appHost, IFileSystem fileSystem, IConfigurationManager config, ICryptographyProvider cryptographyProvider) { _logger = logger; _syncManager = syncManager; _appHost = appHost; _fileSystem = fileSystem; _config = config; + _cryptographyProvider = cryptographyProvider; } public async Task Sync(IServerSyncProvider provider, @@ -360,19 +361,16 @@ namespace MediaBrowser.Server.Implementations.Sync } } - private static string GetLocalId(string jobItemId, string itemId) + private string GetLocalId(string jobItemId, string itemId) { var bytes = Encoding.UTF8.GetBytes(jobItemId + itemId); bytes = CreateMd5(bytes); return BitConverter.ToString(bytes, 0, bytes.Length).Replace("-", string.Empty); } - private static byte[] CreateMd5(byte[] value) + private byte[] CreateMd5(byte[] value) { - using (var provider = MD5.Create()) - { - return provider.ComputeHash(value); - } + return _cryptographyProvider.GetMD5Bytes(value); } public LocalItem CreateLocalItem(IServerSyncProvider provider, SyncedItem syncedItem, SyncJob job, SyncTarget target, BaseItemDto libraryItem, string serverId, string serverName, string originalFileName) diff --git a/MediaBrowser.Server.Implementations/Sync/MultiProviderSync.cs b/Emby.Server.Implementations/Sync/MultiProviderSync.cs similarity index 88% rename from MediaBrowser.Server.Implementations/Sync/MultiProviderSync.cs rename to Emby.Server.Implementations/Sync/MultiProviderSync.cs index 4716041177..db6cfcbd6d 100644 --- a/MediaBrowser.Server.Implementations/Sync/MultiProviderSync.cs +++ b/Emby.Server.Implementations/Sync/MultiProviderSync.cs @@ -11,9 +11,10 @@ using System.Threading; using System.Threading.Tasks; using MediaBrowser.Common.IO; using MediaBrowser.Controller.IO; +using MediaBrowser.Model.Cryptography; using MediaBrowser.Model.IO; -namespace MediaBrowser.Server.Implementations.Sync +namespace Emby.Server.Implementations.Sync { public class MultiProviderSync { @@ -22,14 +23,16 @@ namespace MediaBrowser.Server.Implementations.Sync private readonly ILogger _logger; private readonly IFileSystem _fileSystem; private readonly IConfigurationManager _config; + private readonly ICryptographyProvider _cryptographyProvider; - public MultiProviderSync(SyncManager syncManager, IServerApplicationHost appHost, ILogger logger, IFileSystem fileSystem, IConfigurationManager config) + public MultiProviderSync(SyncManager syncManager, IServerApplicationHost appHost, ILogger logger, IFileSystem fileSystem, IConfigurationManager config, ICryptographyProvider cryptographyProvider) { _syncManager = syncManager; _appHost = appHost; _logger = logger; _fileSystem = fileSystem; _config = config; + _cryptographyProvider = cryptographyProvider; } public async Task Sync(IEnumerable providers, IProgress progress, CancellationToken cancellationToken) @@ -61,7 +64,7 @@ namespace MediaBrowser.Server.Implementations.Sync var dataProvider = _syncManager.GetDataProvider(target.Item1, target.Item2); - await new MediaSync(_logger, _syncManager, _appHost, _fileSystem, _config) + await new MediaSync(_logger, _syncManager, _appHost, _fileSystem, _config, _cryptographyProvider) .Sync(target.Item1, dataProvider, target.Item2, innerProgress, cancellationToken) .ConfigureAwait(false); diff --git a/MediaBrowser.Server.Implementations/Sync/ServerSyncScheduledTask.cs b/Emby.Server.Implementations/Sync/ServerSyncScheduledTask.cs similarity index 87% rename from MediaBrowser.Server.Implementations/Sync/ServerSyncScheduledTask.cs rename to Emby.Server.Implementations/Sync/ServerSyncScheduledTask.cs index dc7f925a0a..17171633e7 100644 --- a/MediaBrowser.Server.Implementations/Sync/ServerSyncScheduledTask.cs +++ b/Emby.Server.Implementations/Sync/ServerSyncScheduledTask.cs @@ -7,10 +7,11 @@ using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; +using MediaBrowser.Model.Cryptography; using MediaBrowser.Model.IO; using MediaBrowser.Model.Tasks; -namespace MediaBrowser.Server.Implementations.Sync +namespace Emby.Server.Implementations.Sync { class ServerSyncScheduledTask : IScheduledTask, IConfigurableScheduledTask { @@ -19,14 +20,16 @@ namespace MediaBrowser.Server.Implementations.Sync private readonly IFileSystem _fileSystem; private readonly IServerApplicationHost _appHost; private readonly IConfigurationManager _config; + private readonly ICryptographyProvider _cryptographyProvider; - public ServerSyncScheduledTask(ISyncManager syncManager, ILogger logger, IFileSystem fileSystem, IServerApplicationHost appHost, IConfigurationManager config) + public ServerSyncScheduledTask(ISyncManager syncManager, ILogger logger, IFileSystem fileSystem, IServerApplicationHost appHost, IConfigurationManager config, ICryptographyProvider cryptographyProvider) { _syncManager = syncManager; _logger = logger; _fileSystem = fileSystem; _appHost = appHost; _config = config; + _cryptographyProvider = cryptographyProvider; } public string Name @@ -49,7 +52,7 @@ namespace MediaBrowser.Server.Implementations.Sync public Task Execute(CancellationToken cancellationToken, IProgress progress) { - return new MultiProviderSync((SyncManager)_syncManager, _appHost, _logger, _fileSystem, _config) + return new MultiProviderSync((SyncManager)_syncManager, _appHost, _logger, _fileSystem, _config, _cryptographyProvider) .Sync(ServerSyncProviders, progress, cancellationToken); } diff --git a/MediaBrowser.Server.Implementations/Sync/SyncConfig.cs b/Emby.Server.Implementations/Sync/SyncConfig.cs similarity index 93% rename from MediaBrowser.Server.Implementations/Sync/SyncConfig.cs rename to Emby.Server.Implementations/Sync/SyncConfig.cs index 52c7743307..8a97326bda 100644 --- a/MediaBrowser.Server.Implementations/Sync/SyncConfig.cs +++ b/Emby.Server.Implementations/Sync/SyncConfig.cs @@ -2,7 +2,7 @@ using MediaBrowser.Model.Sync; using System.Collections.Generic; -namespace MediaBrowser.Server.Implementations.Sync +namespace Emby.Server.Implementations.Sync { public class SyncConfigurationFactory : IConfigurationFactory { diff --git a/MediaBrowser.Server.Implementations/Sync/SyncConvertScheduledTask.cs b/Emby.Server.Implementations/Sync/SyncConvertScheduledTask.cs similarity index 98% rename from MediaBrowser.Server.Implementations/Sync/SyncConvertScheduledTask.cs rename to Emby.Server.Implementations/Sync/SyncConvertScheduledTask.cs index 3a5023fe5e..8dafac7e10 100644 --- a/MediaBrowser.Server.Implementations/Sync/SyncConvertScheduledTask.cs +++ b/Emby.Server.Implementations/Sync/SyncConvertScheduledTask.cs @@ -13,7 +13,7 @@ using MediaBrowser.Controller.IO; using MediaBrowser.Model.IO; using MediaBrowser.Model.Tasks; -namespace MediaBrowser.Server.Implementations.Sync +namespace Emby.Server.Implementations.Sync { public class SyncConvertScheduledTask : IScheduledTask { diff --git a/MediaBrowser.Server.Implementations/Sync/SyncHelper.cs b/Emby.Server.Implementations/Sync/SyncHelper.cs similarity index 92% rename from MediaBrowser.Server.Implementations/Sync/SyncHelper.cs rename to Emby.Server.Implementations/Sync/SyncHelper.cs index fb4e0c6be0..da475f0038 100644 --- a/MediaBrowser.Server.Implementations/Sync/SyncHelper.cs +++ b/Emby.Server.Implementations/Sync/SyncHelper.cs @@ -1,6 +1,6 @@ using System; -namespace MediaBrowser.Server.Implementations.Sync +namespace Emby.Server.Implementations.Sync { public class SyncHelper { diff --git a/MediaBrowser.Server.Implementations/Sync/SyncJobOptions.cs b/Emby.Server.Implementations/Sync/SyncJobOptions.cs similarity index 91% rename from MediaBrowser.Server.Implementations/Sync/SyncJobOptions.cs rename to Emby.Server.Implementations/Sync/SyncJobOptions.cs index cb8141c895..8e4d8e2edc 100644 --- a/MediaBrowser.Server.Implementations/Sync/SyncJobOptions.cs +++ b/Emby.Server.Implementations/Sync/SyncJobOptions.cs @@ -1,6 +1,6 @@ using MediaBrowser.Model.Dlna; -namespace MediaBrowser.Server.Implementations.Sync +namespace Emby.Server.Implementations.Sync { public class SyncJobOptions { diff --git a/MediaBrowser.Server.Implementations/Sync/SyncJobProcessor.cs b/Emby.Server.Implementations/Sync/SyncJobProcessor.cs similarity index 99% rename from MediaBrowser.Server.Implementations/Sync/SyncJobProcessor.cs rename to Emby.Server.Implementations/Sync/SyncJobProcessor.cs index 8d2c0b20c2..415757609d 100644 --- a/MediaBrowser.Server.Implementations/Sync/SyncJobProcessor.cs +++ b/Emby.Server.Implementations/Sync/SyncJobProcessor.cs @@ -28,7 +28,7 @@ using MediaBrowser.Model.IO; using MediaBrowser.Model.Extensions; using MediaBrowser.Model.IO; -namespace MediaBrowser.Server.Implementations.Sync +namespace Emby.Server.Implementations.Sync { public class SyncJobProcessor { diff --git a/MediaBrowser.Server.Implementations/Sync/SyncManager.cs b/Emby.Server.Implementations/Sync/SyncManager.cs similarity index 99% rename from MediaBrowser.Server.Implementations/Sync/SyncManager.cs rename to Emby.Server.Implementations/Sync/SyncManager.cs index 7bcb7b05ed..d06ed49fd0 100644 --- a/MediaBrowser.Server.Implementations/Sync/SyncManager.cs +++ b/Emby.Server.Implementations/Sync/SyncManager.cs @@ -23,6 +23,7 @@ using MediaBrowser.Model.Users; using System; using System.Collections.Concurrent; using System.Collections.Generic; +using System.Globalization; using System.IO; using System.Linq; using System.Threading; @@ -30,7 +31,7 @@ using System.Threading.Tasks; using MediaBrowser.Model.IO; using MediaBrowser.Model.Tasks; -namespace MediaBrowser.Server.Implementations.Sync +namespace Emby.Server.Implementations.Sync { public class SyncManager : ISyncManager { @@ -124,7 +125,7 @@ namespace MediaBrowser.Server.Implementations.Sync if (string.IsNullOrWhiteSpace(request.Name)) { - request.Name = DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString(); + request.Name = DateTime.Now.ToString("f1", CultureInfo.CurrentCulture); } var target = GetSyncTargets(request.UserId) @@ -419,7 +420,7 @@ namespace MediaBrowser.Server.Implementations.Sync { _fileSystem.DeleteDirectory(path, true); } - catch (DirectoryNotFoundException) + catch (IOException) { } @@ -574,7 +575,7 @@ namespace MediaBrowser.Server.Implementations.Sync { _fileSystem.DeleteDirectory(jobItem.TemporaryPath, true); } - catch (DirectoryNotFoundException) + catch (IOException) { } catch (Exception ex) @@ -1061,7 +1062,7 @@ namespace MediaBrowser.Server.Implementations.Sync { _fileSystem.DeleteDirectory(path, true); } - catch (DirectoryNotFoundException) + catch (IOException) { } diff --git a/MediaBrowser.Server.Implementations/Sync/SyncNotificationEntryPoint.cs b/Emby.Server.Implementations/Sync/SyncNotificationEntryPoint.cs similarity index 96% rename from MediaBrowser.Server.Implementations/Sync/SyncNotificationEntryPoint.cs rename to Emby.Server.Implementations/Sync/SyncNotificationEntryPoint.cs index 7017b422ee..46cdb28a4d 100644 --- a/MediaBrowser.Server.Implementations/Sync/SyncNotificationEntryPoint.cs +++ b/Emby.Server.Implementations/Sync/SyncNotificationEntryPoint.cs @@ -5,7 +5,7 @@ using MediaBrowser.Controller.Sync; using MediaBrowser.Model.Events; using MediaBrowser.Model.Sync; -namespace MediaBrowser.Server.Implementations.Sync +namespace Emby.Server.Implementations.Sync { public class SyncNotificationEntryPoint : IServerEntryPoint { diff --git a/MediaBrowser.Server.Implementations/Sync/SyncRegistrationInfo.cs b/Emby.Server.Implementations/Sync/SyncRegistrationInfo.cs similarity index 93% rename from MediaBrowser.Server.Implementations/Sync/SyncRegistrationInfo.cs rename to Emby.Server.Implementations/Sync/SyncRegistrationInfo.cs index 40b84b1c21..c2658c5c54 100644 --- a/MediaBrowser.Server.Implementations/Sync/SyncRegistrationInfo.cs +++ b/Emby.Server.Implementations/Sync/SyncRegistrationInfo.cs @@ -1,7 +1,7 @@ using MediaBrowser.Common.Security; using System.Threading.Tasks; -namespace MediaBrowser.Server.Implementations.Sync +namespace Emby.Server.Implementations.Sync { public class SyncRegistrationInfo : IRequiresRegistration { diff --git a/MediaBrowser.Server.Implementations/Sync/SyncedMediaSourceProvider.cs b/Emby.Server.Implementations/Sync/SyncedMediaSourceProvider.cs similarity index 97% rename from MediaBrowser.Server.Implementations/Sync/SyncedMediaSourceProvider.cs rename to Emby.Server.Implementations/Sync/SyncedMediaSourceProvider.cs index e0553b1b16..1e54885e67 100644 --- a/MediaBrowser.Server.Implementations/Sync/SyncedMediaSourceProvider.cs +++ b/Emby.Server.Implementations/Sync/SyncedMediaSourceProvider.cs @@ -12,7 +12,7 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; -namespace MediaBrowser.Server.Implementations.Sync +namespace Emby.Server.Implementations.Sync { public class SyncedMediaSourceProvider : IMediaSourceProvider { @@ -144,7 +144,7 @@ namespace MediaBrowser.Server.Implementations.Sync { mediaSource.Id = item.Id; mediaSource.SupportsTranscoding = false; - if (mediaSource.Protocol == Model.MediaInfo.MediaProtocol.File) + if (mediaSource.Protocol == MediaBrowser.Model.MediaInfo.MediaProtocol.File) { mediaSource.ETag = item.Id; } diff --git a/MediaBrowser.Server.Implementations/Sync/TargetDataProvider.cs b/Emby.Server.Implementations/Sync/TargetDataProvider.cs similarity index 99% rename from MediaBrowser.Server.Implementations/Sync/TargetDataProvider.cs rename to Emby.Server.Implementations/Sync/TargetDataProvider.cs index 03df0d4e66..a0e0f4313f 100644 --- a/MediaBrowser.Server.Implementations/Sync/TargetDataProvider.cs +++ b/Emby.Server.Implementations/Sync/TargetDataProvider.cs @@ -11,7 +11,7 @@ using System.Threading; using System.Threading.Tasks; using MediaBrowser.Model.IO; -namespace MediaBrowser.Server.Implementations.Sync +namespace Emby.Server.Implementations.Sync { public class TargetDataProvider : ISyncDataProvider { diff --git a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs index 1248d138db..0baee67eae 100644 --- a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs +++ b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs @@ -793,7 +793,9 @@ namespace MediaBrowser.MediaEncoding.Subtitles { if (protocol == MediaProtocol.File) { - if (_textEncoding.GetFileEncoding(path).Equals(Encoding.UTF8)) + var fileEncoding = _textEncoding.GetFileEncoding(path); + + if (fileEncoding != null && fileEncoding.Equals(Encoding.UTF8)) { return string.Empty; } diff --git a/MediaBrowser.Model/Cryptography/ICryptographyProvider.cs b/MediaBrowser.Model/Cryptography/ICryptographyProvider.cs index 696a7c1009..a3f86f9e28 100644 --- a/MediaBrowser.Model/Cryptography/ICryptographyProvider.cs +++ b/MediaBrowser.Model/Cryptography/ICryptographyProvider.cs @@ -9,5 +9,6 @@ namespace MediaBrowser.Model.Cryptography byte[] GetMD5Bytes(string str); byte[] GetSHA1Bytes(byte[] bytes); byte[] GetMD5Bytes(Stream str); + byte[] GetMD5Bytes(byte[] bytes); } } \ No newline at end of file diff --git a/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs b/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs index 1f2a6255ed..49cb1e75f4 100644 --- a/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs +++ b/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs @@ -4,7 +4,6 @@ using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Plugins; using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Logging; -using Microsoft.Win32; using System; using System.Collections.Concurrent; using System.Collections.Generic; @@ -17,6 +16,7 @@ using MediaBrowser.Controller; using MediaBrowser.Controller.IO; using MediaBrowser.Model.Tasks; using MediaBrowser.Model.Threading; +using Microsoft.Win32; namespace MediaBrowser.Server.Implementations.IO { diff --git a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj index b31c8286cd..5d1d2fc38c 100644 --- a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj +++ b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj @@ -144,7 +144,6 @@ - @@ -202,17 +201,12 @@ - - - - - @@ -235,23 +229,9 @@ - - - - - - - - - - - - - - diff --git a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs index 861d59908e..11d401670f 100644 --- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs +++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs @@ -83,7 +83,10 @@ using System.Threading; using System.Threading.Tasks; using Emby.Common.Implementations; using Emby.Common.Implementations.Networking; +using Emby.Common.Implementations.Reflection; +using Emby.Common.Implementations.TextEncoding; using Emby.Common.Implementations.Updates; +using Emby.Common.Implementations.Xml; using Emby.Photos; using MediaBrowser.Model.IO; using MediaBrowser.Api.Playback; @@ -110,6 +113,7 @@ using Emby.Server.Implementations.MediaEncoder; using Emby.Server.Implementations.Notifications; using Emby.Server.Implementations.Persistence; using Emby.Server.Implementations.Playlists; +using Emby.Server.Implementations.Sync; using Emby.Server.Implementations.TV; using Emby.Server.Implementations.Updates; using MediaBrowser.Model.Activity; @@ -124,10 +128,7 @@ using MediaBrowser.Model.Social; using MediaBrowser.Model.TextEncoding; using MediaBrowser.Model.Xml; using MediaBrowser.Server.Implementations.Archiving; -using MediaBrowser.Server.Implementations.Reflection; using MediaBrowser.Server.Implementations.Serialization; -using MediaBrowser.Server.Implementations.TextEncoding; -using MediaBrowser.Server.Implementations.Xml; using OpenSubtitlesHandler; using ServiceStack; using StringExtensions = MediaBrowser.Controller.Extensions.StringExtensions;