Browse Source

move classes to portable server lib

Luke Pulverenti 8 years ago
parent
commit
b76a1abda5

+ 9 - 0
Emby.Common.Implementations/Cryptography/CryptographyProvider.cs

@@ -19,6 +19,15 @@ namespace Emby.Common.Implementations.Cryptography
                 return 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())

+ 1 - 1
MediaBrowser.Server.Implementations/EntryPoints/ActivityLogEntryPoint.cs → 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
     {

+ 2 - 4
MediaBrowser.Server.Implementations/Collections/CollectionImageProvider.cs → 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>
     {

+ 1 - 1
MediaBrowser.Server.Implementations/Devices/DeviceManager.cs → 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
     {

+ 13 - 0
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">

+ 2 - 2
MediaBrowser.Server.Implementations/Photos/BaseDynamicImageProvider.cs → 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>, IHasOrder
         where T : IHasMetadata
@@ -353,7 +353,7 @@ namespace MediaBrowser.Server.Implementations.Photos
             var ext = Path.GetExtension(image);
 
             var outputPath = Path.ChangeExtension(outputPathWithoutExtension, ext);
-            File.Copy(image, outputPath);
+            FileSystem.CopyFile(image, outputPath, true);
 
             return outputPath;
         }

+ 1 - 1
MediaBrowser.Server.Implementations/Library/UserDataManager.cs → 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 UserDataManager

+ 31 - 23
MediaBrowser.Server.Implementations/Library/UserManager.cs → 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.Library
         private 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.Library
         public 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.Library
             text.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.Library
                     return (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.Library
 
             var path = GetPolifyFilePath(user);
 
-			_fileSystem.CreateDirectory(Path.GetDirectoryName(path));
+            _fileSystem.CreateDirectory(Path.GetDirectoryName(path));
 
             lock (_policySyncLock)
             {
@@ -970,11 +978,11 @@ namespace MediaBrowser.Server.Implementations.Library
                     return (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.Library
                 config = _jsonSerializer.DeserializeFromString<UserConfiguration>(json);
             }
 
-			_fileSystem.CreateDirectory(Path.GetDirectoryName(path));
+            _fileSystem.CreateDirectory(Path.GetDirectoryName(path));
 
             lock (_configSyncLock)
             {

+ 7 - 4
MediaBrowser.Server.Implementations/EntryPoints/Notifications/Notifications.cs → 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.Notifications
         private 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);
                 }
                 else

+ 1 - 1
MediaBrowser.Server.Implementations/EntryPoints/Notifications/WebSocketNotifier.cs → 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 udpated

+ 2 - 3
MediaBrowser.Server.Implementations/Photos/PhotoAlbumImageProvider.cs → 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>
     {

+ 2 - 2
MediaBrowser.Server.Implementations/Playlists/PlaylistImageProvider.cs → 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>
     {

+ 1 - 1
MediaBrowser.Server.Implementations/TV/TVSeriesManager.cs → 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
     {

+ 2 - 2
MediaBrowser.Server.Implementations/UserViews/CollectionFolderImageProvider.cs → 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>
     {

+ 2 - 4
MediaBrowser.Server.Implementations/UserViews/DynamicImageProvider.cs → 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>
     {

+ 1 - 0
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);
     }
 }

+ 0 - 13
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" />

+ 3 - 6
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.Common
             SyncRepository = 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);