The Free Software Media System - Server Backend & API
move classes to portable server lib
Luke Pulverentib76a1abda578
diff --git a/Emby.Common.Implementations/Cryptography/CryptographyProvider.cs b/Emby.Common.Implementations/Cryptography/CryptographyProvider.csindex 5ece28dc67..e5e4b1c7c1 100644--- a/Emby.Common.Implementations/Cryptography/CryptographyProvider.cs+++ b/Emby.Common.Implementations/Cryptography/CryptographyProvider.cs@@ -19,6 +19,15 @@ namespace Emby.Common.Implementations.Cryptographyreturn provider.ComputeHash(Encoding.Unicode.GetBytes(str));}}++ public byte[] GetSHA1Bytes(byte[] bytes)+ {+ using (var provider = SHA1.Create())+ {+ return provider.ComputeHash(bytes);+ }+ }+public byte[] GetMD5Bytes(Stream str){using (var provider = MD5.Create())diff --git a/MediaBrowser.Server.Implementations/EntryPoints/ActivityLogEntryPoint.cs b/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cssimilarity index 99%rename from MediaBrowser.Server.Implementations/EntryPoints/ActivityLogEntryPoint.csrename to Emby.Server.Implementations/Activity/ActivityLogEntryPoint.csindex 51f5f57b3e..11fd3a872e 100644--- a/MediaBrowser.Server.Implementations/EntryPoints/ActivityLogEntryPoint.cs+++ b/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs@@ -19,7 +19,7 @@ using System.Linq;using System.Text;using MediaBrowser.Model.Globalization;-namespace MediaBrowser.Server.Implementations.EntryPoints+namespace Emby.Server.Implementations.Activity{public class ActivityLogEntryPoint : IServerEntryPoint{diff --git a/MediaBrowser.Server.Implementations/Collections/CollectionImageProvider.cs b/Emby.Server.Implementations/Collections/CollectionImageProvider.cssimilarity index 94%rename from MediaBrowser.Server.Implementations/Collections/CollectionImageProvider.csrename to Emby.Server.Implementations/Collections/CollectionImageProvider.csindex d70d4b9e65..b82d4e44e0 100644--- a/MediaBrowser.Server.Implementations/Collections/CollectionImageProvider.cs+++ b/Emby.Server.Implementations/Collections/CollectionImageProvider.cs@@ -6,16 +6,14 @@ using MediaBrowser.Controller.Entities.Movies;using MediaBrowser.Controller.Entities.TV;using MediaBrowser.Controller.Providers;using MediaBrowser.Model.Entities;-using MediaBrowser.Server.Implementations.Photos;using System.Collections.Generic;using System.Linq;using System.Threading.Tasks;-using MediaBrowser.Common.IO;-using MediaBrowser.Controller.IO;+using Emby.Server.Implementations.Images;using MediaBrowser.Model.IO;using MediaBrowser.Model.Extensions;-namespace MediaBrowser.Server.Implementations.Collections+namespace Emby.Server.Implementations.Collections{public class CollectionImageProvider : BaseDynamicImageProvider<BoxSet>{diff --git a/MediaBrowser.Server.Implementations/Devices/DeviceManager.cs b/Emby.Server.Implementations/Devices/DeviceManager.cssimilarity index 99%rename from MediaBrowser.Server.Implementations/Devices/DeviceManager.csrename to Emby.Server.Implementations/Devices/DeviceManager.csindex e2e59df088..cdf636e22d 100644--- a/MediaBrowser.Server.Implementations/Devices/DeviceManager.cs+++ b/Emby.Server.Implementations/Devices/DeviceManager.cs@@ -21,7 +21,7 @@ using MediaBrowser.Model.IO;using MediaBrowser.Controller.Configuration;using MediaBrowser.Controller.IO;-namespace MediaBrowser.Server.Implementations.Devices+namespace Emby.Server.Implementations.Devices{public class DeviceManager : IDeviceManager{diff --git a/Emby.Server.Implementations/Emby.Server.Implementations.csproj b/Emby.Server.Implementations/Emby.Server.Implementations.csprojindex 11b3393c8a..567c9b99ed 100644--- a/Emby.Server.Implementations/Emby.Server.Implementations.csproj+++ b/Emby.Server.Implementations/Emby.Server.Implementations.csproj@@ -52,6 +52,7 @@<Compile Include="..\SharedVersion.cs"><Link>Properties\SharedVersion.cs</Link></Compile>+ <Compile Include="Activity\ActivityLogEntryPoint.cs" /><Compile Include="Activity\ActivityManager.cs" /><Compile Include="Branding\BrandingConfigurationFactory.cs" /><Compile Include="Channels\ChannelConfigurations.cs" />@@ -60,7 +61,9 @@<Compile Include="Channels\ChannelManager.cs" /><Compile Include="Channels\ChannelPostScanTask.cs" /><Compile Include="Channels\RefreshChannelsScheduledTask.cs" />+ <Compile Include="Collections\CollectionImageProvider.cs" /><Compile Include="Collections\CollectionManager.cs" />+ <Compile Include="Devices\DeviceManager.cs" /><Compile Include="Dto\DtoService.cs" /><Compile Include="FileOrganization\EpisodeFileOrganizer.cs" /><Compile Include="FileOrganization\Extensions.cs" />@@ -69,6 +72,7 @@<Compile Include="FileOrganization\NameUtils.cs" /><Compile Include="FileOrganization\OrganizerScheduledTask.cs" /><Compile Include="FileOrganization\TvFolderOrganizer.cs" />+ <Compile Include="Images\BaseDynamicImageProvider.cs" /><Compile Include="Intros\DefaultIntroProvider.cs" /><Compile Include="Library\CoreResolutionIgnoreRule.cs" /><Compile Include="Library\LibraryManager.cs" />@@ -94,6 +98,8 @@<Compile Include="Library\Resolvers\TV\SeriesResolver.cs" /><Compile Include="Library\Resolvers\VideoResolver.cs" /><Compile Include="Library\SearchEngine.cs" />+ <Compile Include="Library\UserDataManager.cs" />+ <Compile Include="Library\UserManager.cs" /><Compile Include="Library\UserViewManager.cs" /><Compile Include="Library\Validators\ArtistsPostScanTask.cs" /><Compile Include="Library\Validators\ArtistsValidator.cs" />@@ -109,7 +115,11 @@<Compile Include="Library\Validators\YearsPostScanTask.cs" /><Compile Include="Logging\PatternsLogger.cs" /><Compile Include="News\NewsService.cs" />+ <Compile Include="Notifications\Notifications.cs" />+ <Compile Include="Notifications\WebSocketNotifier.cs" /><Compile Include="Persistence\CleanDatabaseScheduledTask.cs" />+ <Compile Include="Photos\PhotoAlbumImageProvider.cs" />+ <Compile Include="Playlists\PlaylistImageProvider.cs" /><Compile Include="Playlists\PlaylistManager.cs" /><Compile Include="Properties\AssemblyInfo.cs" /><Compile Include="ScheduledTasks\ChapterImagesTask.cs" />@@ -149,7 +159,10 @@<Compile Include="Sorting\SortNameComparer.cs" /><Compile Include="Sorting\StartDateComparer.cs" /><Compile Include="Sorting\StudioComparer.cs" />+ <Compile Include="TV\TVSeriesManager.cs" /><Compile Include="Updates\InstallationManager.cs" />+ <Compile Include="UserViews\CollectionFolderImageProvider.cs" />+ <Compile Include="UserViews\DynamicImageProvider.cs" /></ItemGroup><ItemGroup><Reference Include="MediaBrowser.Naming, Version=1.0.6146.28476, Culture=neutral, processorArchitecture=MSIL">diff --git a/MediaBrowser.Server.Implementations/Photos/BaseDynamicImageProvider.cs b/Emby.Server.Implementations/Images/BaseDynamicImageProvider.cssimilarity index 99%rename from MediaBrowser.Server.Implementations/Photos/BaseDynamicImageProvider.csrename to Emby.Server.Implementations/Images/BaseDynamicImageProvider.csindex 0dd7672bc1..224cd056aa 100644--- a/MediaBrowser.Server.Implementations/Photos/BaseDynamicImageProvider.cs+++ b/Emby.Server.Implementations/Images/BaseDynamicImageProvider.cs@@ -18,7 +18,7 @@ using MediaBrowser.Controller.Entities.Audio;using MediaBrowser.Controller.IO;using MediaBrowser.Model.Configuration;-namespace MediaBrowser.Server.Implementations.Photos+namespace Emby.Server.Implementations.Images{public abstract class BaseDynamicImageProvider<T> : IHasItemChangeMonitor, IForcedProvider, ICustomMetadataProvider<T>, IHasOrderwhere T : IHasMetadata@@ -353,7 +353,7 @@ namespace MediaBrowser.Server.Implementations.Photosvar ext = Path.GetExtension(image);var outputPath = Path.ChangeExtension(outputPathWithoutExtension, ext);- File.Copy(image, outputPath);+ FileSystem.CopyFile(image, outputPath, true);return outputPath;}diff --git a/MediaBrowser.Server.Implementations/Library/UserDataManager.cs b/Emby.Server.Implementations/Library/UserDataManager.cssimilarity index 99%rename from MediaBrowser.Server.Implementations/Library/UserDataManager.csrename to Emby.Server.Implementations/Library/UserDataManager.csindex 9ee65a57c6..c8dde1287a 100644--- a/MediaBrowser.Server.Implementations/Library/UserDataManager.cs+++ b/Emby.Server.Implementations/Library/UserDataManager.cs@@ -13,7 +13,7 @@ using System.Collections.Generic;using System.Threading;using System.Threading.Tasks;-namespace MediaBrowser.Server.Implementations.Library+namespace Emby.Server.Implementations.Library{/// <summary>/// Class UserDataManagerdiff --git a/MediaBrowser.Server.Implementations/Library/UserManager.cs b/Emby.Server.Implementations/Library/UserManager.cssimilarity index 95%rename from MediaBrowser.Server.Implementations/Library/UserManager.csrename to Emby.Server.Implementations/Library/UserManager.csindex 794c924eb6..9c1d7fdf13 100644--- a/MediaBrowser.Server.Implementations/Library/UserManager.cs+++ b/Emby.Server.Implementations/Library/UserManager.cs@@ -23,15 +23,13 @@ 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 MediaBrowser.Common.IO;-using MediaBrowser.Controller.IO;+using MediaBrowser.Model.Cryptography;using MediaBrowser.Model.IO;-namespace MediaBrowser.Server.Implementations.Library+namespace Emby.Server.Implementations.Library{/// <summary>/// Class UserManager@@ -72,8 +70,10 @@ namespace MediaBrowser.Server.Implementations.Libraryprivate readonly Func<IConnectManager> _connectFactory;private readonly IServerApplicationHost _appHost;private readonly IFileSystem _fileSystem;+ private readonly ICryptographyProvider _cryptographyProvider;+ private readonly string _defaultUserName;- public UserManager(ILogger logger, IServerConfigurationManager configurationManager, IUserRepository userRepository, IXmlSerializer xmlSerializer, INetworkManager networkManager, Func<IImageProcessor> imageProcessorFactory, Func<IDtoService> dtoServiceFactory, Func<IConnectManager> connectFactory, IServerApplicationHost appHost, IJsonSerializer jsonSerializer, IFileSystem fileSystem)+ public UserManager(ILogger logger, IServerConfigurationManager configurationManager, IUserRepository userRepository, IXmlSerializer xmlSerializer, INetworkManager networkManager, Func<IImageProcessor> imageProcessorFactory, Func<IDtoService> dtoServiceFactory, Func<IConnectManager> connectFactory, IServerApplicationHost appHost, IJsonSerializer jsonSerializer, IFileSystem fileSystem, ICryptographyProvider cryptographyProvider, string defaultUserName){_logger = logger;UserRepository = userRepository;@@ -85,6 +85,8 @@ namespace MediaBrowser.Server.Implementations.Library_appHost = appHost;_jsonSerializer = jsonSerializer;_fileSystem = fileSystem;+ _cryptographyProvider = cryptographyProvider;+ _defaultUserName = defaultUserName;ConfigurationManager = configurationManager;Users = new List<User>();@@ -188,7 +190,14 @@ namespace MediaBrowser.Server.Implementations.Librarypublic bool IsValidUsername(string username){// Usernames can contain letters (a-z), numbers (0-9), dashes (-), underscores (_), apostrophes ('), and periods (.)- return username.All(IsValidUsernameCharacter);+ foreach (var currentChar in username)+ {+ if (!IsValidUsernameCharacter(currentChar))+ {+ return false;+ }+ }+ return true;}private bool IsValidUsernameCharacter(char i)@@ -273,8 +282,8 @@ namespace MediaBrowser.Server.Implementations.Library{user.Policy.InvalidLoginAttemptCount = newValue;- var maxCount = user.Policy.IsAdministrator ?- 3 :+ var maxCount = user.Policy.IsAdministrator ?+ 3 :5;var fireLockout = false;@@ -323,13 +332,9 @@ namespace MediaBrowser.Server.Implementations.Library/// </summary>/// <param name="str">The STR.</param>/// <returns>System.String.</returns>- private static string GetSha1String(string str)+ private string GetSha1String(string str){- using (var provider = SHA1.Create())- {- var hash = provider.ComputeHash(Encoding.UTF8.GetBytes(str));- return BitConverter.ToString(hash).Replace("-", string.Empty);- }+ return BitConverter.ToString(_cryptographyProvider.GetSHA1Bytes(Encoding.UTF8.GetBytes(str))).Replace("-", string.Empty);}/// <summary>@@ -343,7 +348,7 @@ namespace MediaBrowser.Server.Implementations.Library// There always has to be at least one user.if (users.Count == 0){- var name = MakeValidUsername(Environment.UserName);+ var name = MakeValidUsername(_defaultUserName);var user = InstantiateNewUser(name);@@ -741,9 +746,12 @@ namespace MediaBrowser.Server.Implementations.Librarytext.AppendLine(string.Empty);text.AppendLine(pin);text.AppendLine(string.Empty);- text.AppendLine("The pin code will expire at " + expiration.ToLocalTime().ToShortDateString() + " " + expiration.ToLocalTime().ToShortTimeString());- _fileSystem.WriteAllText(path, text.ToString(), Encoding.UTF8);+ var localExpirationTime = expiration.ToLocalTime();+ // Tuesday, 22 August 2006 06:30 AM+ text.AppendLine("The pin code will expire at " + localExpirationTime.ToString("f1", CultureInfo.CurrentCulture));++ _fileSystem.WriteAllText(path, text.ToString(), Encoding.UTF8);var result = new PasswordPinCreationResult{@@ -875,11 +883,11 @@ namespace MediaBrowser.Server.Implementations.Libraryreturn (UserPolicy)_xmlSerializer.DeserializeFromFile(typeof(UserPolicy), path);}}- catch (DirectoryNotFoundException)+ catch (FileNotFoundException){return GetDefaultPolicy(user);}- catch (FileNotFoundException)+ catch (IOException){return GetDefaultPolicy(user);}@@ -917,7 +925,7 @@ namespace MediaBrowser.Server.Implementations.Libraryvar path = GetPolifyFilePath(user);- _fileSystem.CreateDirectory(Path.GetDirectoryName(path));+ _fileSystem.CreateDirectory(Path.GetDirectoryName(path));lock (_policySyncLock){@@ -970,11 +978,11 @@ namespace MediaBrowser.Server.Implementations.Libraryreturn (UserConfiguration)_xmlSerializer.DeserializeFromFile(typeof(UserConfiguration), path);}}- catch (DirectoryNotFoundException)+ catch (FileNotFoundException){return new UserConfiguration();}- catch (FileNotFoundException)+ catch (IOException){return new UserConfiguration();}@@ -1004,7 +1012,7 @@ namespace MediaBrowser.Server.Implementations.Libraryconfig = _jsonSerializer.DeserializeFromString<UserConfiguration>(json);}- _fileSystem.CreateDirectory(Path.GetDirectoryName(path));+ _fileSystem.CreateDirectory(Path.GetDirectoryName(path));lock (_configSyncLock){diff --git a/MediaBrowser.Server.Implementations/EntryPoints/Notifications/Notifications.cs b/Emby.Server.Implementations/Notifications/Notifications.cssimilarity index 97%rename from MediaBrowser.Server.Implementations/EntryPoints/Notifications/Notifications.csrename to Emby.Server.Implementations/Notifications/Notifications.csindex f3d1dc8f9b..2d441c18cc 100644--- a/MediaBrowser.Server.Implementations/EntryPoints/Notifications/Notifications.cs+++ b/Emby.Server.Implementations/Notifications/Notifications.cs@@ -22,8 +22,9 @@ using System.Linq;using System.Threading;using System.Threading.Tasks;using MediaBrowser.Controller.Entities.TV;+using MediaBrowser.Model.Threading;-namespace MediaBrowser.Server.Implementations.EntryPoints.Notifications+namespace Emby.Server.Implementations.Notifications{/// <summary>/// Creates notifications for various system events@@ -40,14 +41,15 @@ namespace MediaBrowser.Server.Implementations.EntryPoints.Notificationsprivate readonly ILibraryManager _libraryManager;private readonly ISessionManager _sessionManager;private readonly IServerApplicationHost _appHost;+ private readonly ITimerFactory _timerFactory;- private Timer LibraryUpdateTimer { get; set; }+ private ITimer LibraryUpdateTimer { get; set; }private readonly object _libraryChangedSyncLock = new object();private readonly IConfigurationManager _config;private readonly IDeviceManager _deviceManager;- public Notifications(IInstallationManager installationManager, IUserManager userManager, ILogger logger, ITaskManager taskManager, INotificationManager notificationManager, ILibraryManager libraryManager, ISessionManager sessionManager, IServerApplicationHost appHost, IConfigurationManager config, IDeviceManager deviceManager)+ public Notifications(IInstallationManager installationManager, IUserManager userManager, ILogger logger, ITaskManager taskManager, INotificationManager notificationManager, ILibraryManager libraryManager, ISessionManager sessionManager, IServerApplicationHost appHost, IConfigurationManager config, IDeviceManager deviceManager, ITimerFactory timerFactory){_installationManager = installationManager;_userManager = userManager;@@ -59,6 +61,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints.Notifications_appHost = appHost;_config = config;_deviceManager = deviceManager;+ _timerFactory = timerFactory;}public void Run()@@ -332,7 +335,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints.Notifications{if (LibraryUpdateTimer == null){- LibraryUpdateTimer = new Timer(LibraryUpdateTimerCallback, null, 5000,+ LibraryUpdateTimer = _timerFactory.Create(LibraryUpdateTimerCallback, null, 5000,Timeout.Infinite);}elsediff --git a/MediaBrowser.Server.Implementations/EntryPoints/Notifications/WebSocketNotifier.cs b/Emby.Server.Implementations/Notifications/WebSocketNotifier.cssimilarity index 95%rename from MediaBrowser.Server.Implementations/EntryPoints/Notifications/WebSocketNotifier.csrename to Emby.Server.Implementations/Notifications/WebSocketNotifier.csindex 916b4a6224..8b3367217c 100644--- a/MediaBrowser.Server.Implementations/EntryPoints/Notifications/WebSocketNotifier.cs+++ b/Emby.Server.Implementations/Notifications/WebSocketNotifier.cs@@ -3,7 +3,7 @@ using MediaBrowser.Controller.Notifications;using MediaBrowser.Controller.Plugins;using System.Linq;-namespace MediaBrowser.Server.Implementations.EntryPoints.Notifications+namespace Emby.Server.Implementations.Notifications{/// <summary>/// Notifies clients anytime a notification is added or udpateddiff --git a/MediaBrowser.Server.Implementations/Photos/PhotoAlbumImageProvider.cs b/Emby.Server.Implementations/Photos/PhotoAlbumImageProvider.cssimilarity index 91%rename from MediaBrowser.Server.Implementations/Photos/PhotoAlbumImageProvider.csrename to Emby.Server.Implementations/Photos/PhotoAlbumImageProvider.csindex ab03f5aaa9..cc1756f960 100644--- a/MediaBrowser.Server.Implementations/Photos/PhotoAlbumImageProvider.cs+++ b/Emby.Server.Implementations/Photos/PhotoAlbumImageProvider.cs@@ -5,12 +5,11 @@ using MediaBrowser.Controller.Providers;using System.Collections.Generic;using System.Linq;using System.Threading.Tasks;-using MediaBrowser.Common.IO;-using MediaBrowser.Controller.IO;+using Emby.Server.Implementations.Images;using MediaBrowser.Model.IO;using MediaBrowser.Model.Entities;-namespace MediaBrowser.Server.Implementations.Photos+namespace Emby.Server.Implementations.Photos{public class PhotoAlbumImageProvider : BaseDynamicImageProvider<PhotoAlbum>{diff --git a/MediaBrowser.Server.Implementations/Playlists/PlaylistImageProvider.cs b/Emby.Server.Implementations/Playlists/PlaylistImageProvider.cssimilarity index 97%rename from MediaBrowser.Server.Implementations/Playlists/PlaylistImageProvider.csrename to Emby.Server.Implementations/Playlists/PlaylistImageProvider.csindex 0249b85ee5..ef7d6dba82 100644--- a/MediaBrowser.Server.Implementations/Playlists/PlaylistImageProvider.cs+++ b/Emby.Server.Implementations/Playlists/PlaylistImageProvider.cs@@ -6,10 +6,10 @@ using MediaBrowser.Controller.Entities.TV;using MediaBrowser.Controller.Playlists;using MediaBrowser.Controller.Providers;using MediaBrowser.Model.Entities;-using MediaBrowser.Server.Implementations.Photos;using System.Collections.Generic;using System.Linq;using System.Threading.Tasks;+using Emby.Server.Implementations.Images;using MediaBrowser.Common.IO;using MediaBrowser.Controller.IO;using MediaBrowser.Model.IO;@@ -17,7 +17,7 @@ using MediaBrowser.Controller.Library;using MediaBrowser.Model.Extensions;using MediaBrowser.Model.Querying;-namespace MediaBrowser.Server.Implementations.Playlists+namespace Emby.Server.Implementations.Playlists{public class PlaylistImageProvider : BaseDynamicImageProvider<Playlist>{diff --git a/MediaBrowser.Server.Implementations/TV/TVSeriesManager.cs b/Emby.Server.Implementations/TV/TVSeriesManager.cssimilarity index 99%rename from MediaBrowser.Server.Implementations/TV/TVSeriesManager.csrename to Emby.Server.Implementations/TV/TVSeriesManager.csindex 03e8a9178e..f3bab78834 100644--- a/MediaBrowser.Server.Implementations/TV/TVSeriesManager.cs+++ b/Emby.Server.Implementations/TV/TVSeriesManager.cs@@ -9,7 +9,7 @@ using System.Collections.Generic;using System.Linq;using MediaBrowser.Controller.Configuration;-namespace MediaBrowser.Server.Implementations.TV+namespace Emby.Server.Implementations.TV{public class TVSeriesManager : ITVSeriesManager{diff --git a/MediaBrowser.Server.Implementations/UserViews/CollectionFolderImageProvider.cs b/Emby.Server.Implementations/UserViews/CollectionFolderImageProvider.cssimilarity index 98%rename from MediaBrowser.Server.Implementations/UserViews/CollectionFolderImageProvider.csrename to Emby.Server.Implementations/UserViews/CollectionFolderImageProvider.csindex 33a7b67258..ab63072386 100644--- a/MediaBrowser.Server.Implementations/UserViews/CollectionFolderImageProvider.cs+++ b/Emby.Server.Implementations/UserViews/CollectionFolderImageProvider.cs@@ -5,12 +5,12 @@ using MediaBrowser.Controller.Entities.Audio;using MediaBrowser.Controller.Entities.TV;using MediaBrowser.Controller.Providers;using MediaBrowser.Model.Entities;-using MediaBrowser.Server.Implementations.Photos;using System;using System.Collections.Generic;using System.IO;using System.Linq;using System.Threading.Tasks;+using Emby.Server.Implementations.Images;using MediaBrowser.Common.IO;using MediaBrowser.Model.IO;using MediaBrowser.Controller.Collections;@@ -20,7 +20,7 @@ using MediaBrowser.Controller.Library;using MediaBrowser.Model.Extensions;using MediaBrowser.Model.Querying;-namespace MediaBrowser.Server.Implementations.UserViews+namespace Emby.Server.Implementations.UserViews{public class CollectionFolderImageProvider : BaseDynamicImageProvider<CollectionFolder>{diff --git a/MediaBrowser.Server.Implementations/UserViews/DynamicImageProvider.cs b/Emby.Server.Implementations/UserViews/DynamicImageProvider.cssimilarity index 97%rename from MediaBrowser.Server.Implementations/UserViews/DynamicImageProvider.csrename to Emby.Server.Implementations/UserViews/DynamicImageProvider.csindex 61f3c77f05..09b68c8ea3 100644--- a/MediaBrowser.Server.Implementations/UserViews/DynamicImageProvider.cs+++ b/Emby.Server.Implementations/UserViews/DynamicImageProvider.cs@@ -6,19 +6,17 @@ using MediaBrowser.Controller.Entities.TV;using MediaBrowser.Controller.Library;using MediaBrowser.Controller.Providers;using MediaBrowser.Model.Entities;-using MediaBrowser.Server.Implementations.Photos;using System;using System.Collections.Generic;using System.IO;using System.Linq;using System.Threading.Tasks;-using MediaBrowser.Common.IO;-using MediaBrowser.Controller.IO;+using Emby.Server.Implementations.Images;using MediaBrowser.Model.IO;using MediaBrowser.Controller.LiveTv;using MediaBrowser.Model.Extensions;-namespace MediaBrowser.Server.Implementations.UserViews+namespace Emby.Server.Implementations.UserViews{public class DynamicImageProvider : BaseDynamicImageProvider<UserView>{diff --git a/MediaBrowser.Model/Cryptography/ICryptographyProvider.cs b/MediaBrowser.Model/Cryptography/ICryptographyProvider.csindex 70f6798562..696a7c1009 100644--- a/MediaBrowser.Model/Cryptography/ICryptographyProvider.cs+++ b/MediaBrowser.Model/Cryptography/ICryptographyProvider.cs@@ -7,6 +7,7 @@ namespace MediaBrowser.Model.Cryptography{Guid GetMD5(string str);byte[] GetMD5Bytes(string str);+ byte[] GetSHA1Bytes(byte[] bytes);byte[] GetMD5Bytes(Stream str);}}\ No newline at end of filediff --git a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csprojindex fc71ef8a08..3fb3ca8833 100644--- a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj+++ b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj@@ -111,23 +111,18 @@<Compile Include="Activity\ActivityRepository.cs" /><Compile Include="Archiving\ZipClient.cs" /><Compile Include="Collections\CollectionsDynamicFolder.cs" />- <Compile Include="Collections\CollectionImageProvider.cs" /><Compile Include="Configuration\ServerConfigurationManager.cs" /><Compile Include="Connect\ConnectData.cs" /><Compile Include="Connect\ConnectEntryPoint.cs" /><Compile Include="Connect\ConnectManager.cs" /><Compile Include="Connect\Responses.cs" /><Compile Include="Connect\Validator.cs" />- <Compile Include="Devices\DeviceManager.cs" /><Compile Include="Devices\DeviceRepository.cs" /><Compile Include="Devices\CameraUploadsFolder.cs" />- <Compile Include="EntryPoints\ActivityLogEntryPoint.cs" /><Compile Include="EntryPoints\AutomaticRestartEntryPoint.cs" /><Compile Include="EntryPoints\ExternalPortForwarding.cs" /><Compile Include="EntryPoints\LibraryChangedNotifier.cs" /><Compile Include="EntryPoints\LoadRegistrations.cs" />- <Compile Include="EntryPoints\Notifications\Notifications.cs" />- <Compile Include="EntryPoints\Notifications\WebSocketNotifier.cs" /><Compile Include="EntryPoints\RecordingNotifier.cs" /><Compile Include="EntryPoints\RefreshUsersMetadata.cs" /><Compile Include="EntryPoints\UsageEntryPoint.cs" />@@ -162,8 +157,6 @@<Compile Include="IO\LibraryMonitor.cs" /><Compile Include="IO\MemoryStreamProvider.cs" /><Compile Include="IO\ThrottledStream.cs" />- <Compile Include="Library\UserDataManager.cs" />- <Compile Include="Library\UserManager.cs" /><Compile Include="LiveTv\ChannelImageProvider.cs" /><Compile Include="LiveTv\EmbyTV\DirectRecorder.cs" /><Compile Include="LiveTv\EmbyTV\EmbyTV.cs" />@@ -237,8 +230,6 @@<Compile Include="TextEncoding\TextEncoding.cs" /><Compile Include="Threading\PeriodicTimer.cs" /><Compile Include="TV\SeriesPostScanTask.cs" />- <Compile Include="UserViews\CollectionFolderImageProvider.cs" />- <Compile Include="UserViews\DynamicImageProvider.cs" /><Compile Include="Notifications\CoreNotificationTypes.cs" /><Compile Include="Notifications\InternalNotificationService.cs" /><Compile Include="Notifications\NotificationConfigurationFactory.cs" />@@ -246,10 +237,7 @@<Compile Include="Persistence\SqliteFileOrganizationRepository.cs" /><Compile Include="Notifications\SqliteNotificationsRepository.cs" /><Compile Include="Persistence\TypeMapper.cs" />- <Compile Include="Photos\BaseDynamicImageProvider.cs" /><Compile Include="Playlists\ManualPlaylistsFolder.cs" />- <Compile Include="Photos\PhotoAlbumImageProvider.cs" />- <Compile Include="Playlists\PlaylistImageProvider.cs" /><Compile Include="Properties\AssemblyInfo.cs" /><Compile Include="Security\AuthenticationRepository.cs" /><Compile Include="Security\EncryptionManager.cs" />@@ -280,7 +268,6 @@<Compile Include="Sync\SyncRepository.cs" /><Compile Include="Sync\SyncConvertScheduledTask.cs" /><Compile Include="Sync\TargetDataProvider.cs" />- <Compile Include="TV\TVSeriesManager.cs" /><Compile Include="Udp\UdpMessageReceivedEventArgs.cs" /><Compile Include="Udp\UdpServer.cs" /><Compile Include="Xml\XmlReaderSettingsFactory.cs" />diff --git a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs b/MediaBrowser.Server.Startup.Common/ApplicationHost.csindex eb5a8a2e59..7c8945ff2e 100644--- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs+++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs@@ -50,7 +50,6 @@ using MediaBrowser.Providers.Manager;using MediaBrowser.Providers.Subtitles;using MediaBrowser.Server.Implementations;using MediaBrowser.Server.Implementations.Activity;-using MediaBrowser.Server.Implementations.Collections;using MediaBrowser.Server.Implementations.Configuration;using MediaBrowser.Server.Implementations.Connect;using MediaBrowser.Server.Implementations.Devices;@@ -58,19 +57,16 @@ using MediaBrowser.Server.Implementations.EntryPoints;using MediaBrowser.Server.Implementations.HttpServer;using MediaBrowser.Server.Implementations.HttpServer.Security;using MediaBrowser.Server.Implementations.IO;-using MediaBrowser.Server.Implementations.Library;using MediaBrowser.Server.Implementations.LiveTv;using MediaBrowser.Server.Implementations.Localization;using MediaBrowser.Server.Implementations.MediaEncoder;using MediaBrowser.Server.Implementations.Notifications;using MediaBrowser.Server.Implementations.Persistence;-using MediaBrowser.Server.Implementations.Playlists;using MediaBrowser.Server.Implementations.Security;using MediaBrowser.Server.Implementations.ServerManager;using MediaBrowser.Server.Implementations.Session;using MediaBrowser.Server.Implementations.Social;using MediaBrowser.Server.Implementations.Sync;-using MediaBrowser.Server.Implementations.TV;using MediaBrowser.Server.Startup.Common.FFMpeg;using MediaBrowser.Server.Startup.Common.Migrations;using MediaBrowser.WebDashboard.Api;@@ -98,7 +94,6 @@ using MediaBrowser.Common.Updates;using MediaBrowser.Controller.Entities.Audio;using MediaBrowser.Controller.Entities.Movies;using MediaBrowser.Controller.Entities.TV;-using MediaBrowser.Controller.IO;using Emby.Dlna;using Emby.Dlna.ConnectionManager;using Emby.Dlna.ContentDirectory;@@ -108,11 +103,13 @@ using Emby.Dlna.Ssdp;using Emby.Server.Implementations.Activity;using Emby.Server.Implementations.Channels;using Emby.Server.Implementations.Collections;+using Emby.Server.Implementations.Devices;using Emby.Server.Implementations.Dto;using Emby.Server.Implementations.FileOrganization;using Emby.Server.Implementations.Library;using Emby.Server.Implementations.Persistence;using Emby.Server.Implementations.Playlists;+using Emby.Server.Implementations.TV;using Emby.Server.Implementations.Updates;using MediaBrowser.Model.Activity;using MediaBrowser.Model.Dlna;@@ -582,7 +579,7 @@ namespace MediaBrowser.Server.Startup.CommonSyncRepository = await GetSyncRepository().ConfigureAwait(false);RegisterSingleInstance(SyncRepository);- UserManager = new UserManager(LogManager.GetLogger("UserManager"), ServerConfigurationManager, UserRepository, XmlSerializer, NetworkManager, () => ImageProcessor, () => DtoService, () => ConnectManager, this, JsonSerializer, FileSystemManager);+ UserManager = new UserManager(LogManager.GetLogger("UserManager"), ServerConfigurationManager, UserRepository, XmlSerializer, NetworkManager, () => ImageProcessor, () => DtoService, () => ConnectManager, this, JsonSerializer, FileSystemManager, CryptographyProvider, Environment.UserName);RegisterSingleInstance(UserManager);LibraryManager = new LibraryManager(Logger, TaskManager, UserManager, ServerConfigurationManager, UserDataManager, () => LibraryMonitor, FileSystemManager, () => ProviderManager, () => UserViewManager);