diff options
Diffstat (limited to 'MediaBrowser.Api')
20 files changed, 41 insertions, 57 deletions
diff --git a/MediaBrowser.Api/EnvironmentService.cs b/MediaBrowser.Api/EnvironmentService.cs index 56be18d866..6296711ed3 100644 --- a/MediaBrowser.Api/EnvironmentService.cs +++ b/MediaBrowser.Api/EnvironmentService.cs @@ -1,8 +1,8 @@ -using MediaBrowser.Common.Implementations.HttpServer; -using MediaBrowser.Common.Net; +using MediaBrowser.Common.Net; using MediaBrowser.Controller.IO; using MediaBrowser.Model.IO; using MediaBrowser.Model.Net; +using MediaBrowser.Server.Implementations.HttpServer; using ServiceStack.ServiceHost; using System; using System.Collections.Generic; diff --git a/MediaBrowser.Api/Images/ImageService.cs b/MediaBrowser.Api/Images/ImageService.cs index 1c0e6c68da..d2a612cb9d 100644 --- a/MediaBrowser.Api/Images/ImageService.cs +++ b/MediaBrowser.Api/Images/ImageService.cs @@ -1,11 +1,11 @@ using MediaBrowser.Common.Extensions; using MediaBrowser.Common.IO; -using MediaBrowser.Common.Implementations.HttpServer; using MediaBrowser.Common.Net; using MediaBrowser.Controller; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; using MediaBrowser.Model.Entities; +using MediaBrowser.Server.Implementations.HttpServer; using ServiceStack.ServiceHost; using ServiceStack.Text.Controller; using System; diff --git a/MediaBrowser.Api/Javascript/JavascriptApiClientService.cs b/MediaBrowser.Api/Javascript/JavascriptApiClientService.cs index 165574d747..7c4d0d84f6 100644 --- a/MediaBrowser.Api/Javascript/JavascriptApiClientService.cs +++ b/MediaBrowser.Api/Javascript/JavascriptApiClientService.cs @@ -1,6 +1,6 @@ using MediaBrowser.Common.Extensions; -using MediaBrowser.Common.Implementations.HttpServer; using MediaBrowser.Common.Net; +using MediaBrowser.Server.Implementations.HttpServer; using ServiceStack.ServiceHost; using System; using System.IO; diff --git a/MediaBrowser.Api/Library/LibraryService.cs b/MediaBrowser.Api/Library/LibraryService.cs index b49cc568fe..39cbe64901 100644 --- a/MediaBrowser.Api/Library/LibraryService.cs +++ b/MediaBrowser.Api/Library/LibraryService.cs @@ -1,10 +1,8 @@ using MediaBrowser.Common; -using MediaBrowser.Common.Implementations.HttpServer; -using MediaBrowser.Common.Kernel; -using MediaBrowser.Controller; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; using MediaBrowser.Model.Dto; +using MediaBrowser.Server.Implementations.HttpServer; using ServiceStack.ServiceHost; using System; using System.Collections.Generic; diff --git a/MediaBrowser.Api/Library/LibraryStructureService.cs b/MediaBrowser.Api/Library/LibraryStructureService.cs index df8b2907d8..0ae73ed457 100644 --- a/MediaBrowser.Api/Library/LibraryStructureService.cs +++ b/MediaBrowser.Api/Library/LibraryStructureService.cs @@ -1,7 +1,7 @@ -using MediaBrowser.Common.Implementations.HttpServer; -using MediaBrowser.Controller; +using MediaBrowser.Controller; using MediaBrowser.Controller.Library; using MediaBrowser.Model.Entities; +using MediaBrowser.Server.Implementations.HttpServer; using ServiceStack.ServiceHost; using System; using System.Collections.Generic; diff --git a/MediaBrowser.Api/LocalizationService.cs b/MediaBrowser.Api/LocalizationService.cs index 18c33a90a4..1493e8e44f 100644 --- a/MediaBrowser.Api/LocalizationService.cs +++ b/MediaBrowser.Api/LocalizationService.cs @@ -1,7 +1,7 @@ -using MediaBrowser.Common.Implementations.HttpServer; -using MediaBrowser.Controller.Localization; +using MediaBrowser.Controller.Localization; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Globalization; +using MediaBrowser.Server.Implementations.HttpServer; using MoreLinq; using ServiceStack.ServiceHost; using System.Collections.Generic; diff --git a/MediaBrowser.Api/MediaBrowser.Api.csproj b/MediaBrowser.Api/MediaBrowser.Api.csproj index c7bba4e9a8..5cedbf85fb 100644 --- a/MediaBrowser.Api/MediaBrowser.Api.csproj +++ b/MediaBrowser.Api/MediaBrowser.Api.csproj @@ -121,10 +121,6 @@ <Compile Include="WebSocket\SystemInfoWebSocketListener.cs" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\MediaBrowser.Common.Implementations\MediaBrowser.Common.Implementations.csproj"> - <Project>{c4d2573a-3fd3-441f-81af-174ac4cd4e1d}</Project> - <Name>MediaBrowser.Common.Implementations</Name> - </ProjectReference> <ProjectReference Include="..\MediaBrowser.Common\MediaBrowser.Common.csproj"> <Project>{9142eefa-7570-41e1-bfcc-468bb571af2f}</Project> <Name>MediaBrowser.Common</Name> @@ -137,6 +133,10 @@ <Project>{7eeeb4bb-f3e8-48fc-b4c5-70f0fff8329b}</Project> <Name>MediaBrowser.Model</Name> </ProjectReference> + <ProjectReference Include="..\MediaBrowser.Server.Implementations\MediaBrowser.Server.Implementations.csproj"> + <Project>{2e781478-814d-4a48-9d80-bff206441a65}</Project> + <Name>MediaBrowser.Server.Implementations</Name> + </ProjectReference> </ItemGroup> <ItemGroup> <None Include="packages.config" /> diff --git a/MediaBrowser.Api/PackageService.cs b/MediaBrowser.Api/PackageService.cs index 1c0508c6d9..e8ff02539c 100644 --- a/MediaBrowser.Api/PackageService.cs +++ b/MediaBrowser.Api/PackageService.cs @@ -1,8 +1,8 @@ using MediaBrowser.Common; using MediaBrowser.Common.Extensions; -using MediaBrowser.Common.Implementations.HttpServer; using MediaBrowser.Controller.Updates; using MediaBrowser.Model.Updates; +using MediaBrowser.Server.Implementations.HttpServer; using ServiceStack.ServiceHost; using System; using System.Collections.Generic; diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index 5107d13c21..796366181e 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -1,5 +1,4 @@ using MediaBrowser.Common.Extensions; -using MediaBrowser.Common.Implementations.HttpServer; using MediaBrowser.Common.IO; using MediaBrowser.Controller; using MediaBrowser.Controller.Entities; @@ -15,6 +14,7 @@ using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; +using MediaBrowser.Server.Implementations.HttpServer; namespace MediaBrowser.Api.Playback { diff --git a/MediaBrowser.Api/PluginService.cs b/MediaBrowser.Api/PluginService.cs index bec6835e0b..847478beb1 100644 --- a/MediaBrowser.Api/PluginService.cs +++ b/MediaBrowser.Api/PluginService.cs @@ -1,11 +1,11 @@ using MediaBrowser.Common; using MediaBrowser.Common.Extensions; -using MediaBrowser.Common.Implementations.HttpServer; using MediaBrowser.Common.Security; using MediaBrowser.Controller.Updates; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Plugins; using MediaBrowser.Model.Serialization; +using MediaBrowser.Server.Implementations.HttpServer; using ServiceStack.ServiceHost; using ServiceStack.Text.Controller; using System; diff --git a/MediaBrowser.Api/ScheduledTasks/ScheduledTaskService.cs b/MediaBrowser.Api/ScheduledTasks/ScheduledTaskService.cs index 0c18725faa..5117dc7ac8 100644 --- a/MediaBrowser.Api/ScheduledTasks/ScheduledTaskService.cs +++ b/MediaBrowser.Api/ScheduledTasks/ScheduledTaskService.cs @@ -1,8 +1,8 @@ using MediaBrowser.Common.Extensions; -using MediaBrowser.Common.Implementations.HttpServer; using MediaBrowser.Common.ScheduledTasks; using MediaBrowser.Model.Serialization; using MediaBrowser.Model.Tasks; +using MediaBrowser.Server.Implementations.HttpServer; using ServiceStack.ServiceHost; using ServiceStack.Text.Controller; using System; @@ -85,29 +85,18 @@ namespace MediaBrowser.Api.ScheduledTasks private ITaskManager TaskManager { get; set; } /// <summary> - /// The _json serializer - /// </summary> - private readonly IJsonSerializer _jsonSerializer; - - /// <summary> /// Initializes a new instance of the <see cref="ScheduledTaskService" /> class. /// </summary> /// <param name="taskManager">The task manager.</param> - /// <param name="jsonSerializer">The json serializer.</param> /// <exception cref="System.ArgumentNullException">taskManager</exception> - public ScheduledTaskService(ITaskManager taskManager, IJsonSerializer jsonSerializer) + public ScheduledTaskService(ITaskManager taskManager) { if (taskManager == null) { throw new ArgumentNullException("taskManager"); } - if (jsonSerializer == null) - { - throw new ArgumentNullException("jsonSerializer"); - } TaskManager = taskManager; - _jsonSerializer = jsonSerializer; } /// <summary> @@ -157,7 +146,7 @@ namespace MediaBrowser.Api.ScheduledTasks throw new ResourceNotFoundException("Task not found"); } - task.Execute(); + TaskManager.Execute(task); } /// <summary> @@ -174,7 +163,7 @@ namespace MediaBrowser.Api.ScheduledTasks throw new ResourceNotFoundException("Task not found"); } - task.Cancel(); + TaskManager.Cancel(task); } /// <summary> diff --git a/MediaBrowser.Api/ScheduledTasks/ScheduledTasksWebSocketListener.cs b/MediaBrowser.Api/ScheduledTasks/ScheduledTasksWebSocketListener.cs index 4ef791e23b..20634301a3 100644 --- a/MediaBrowser.Api/ScheduledTasks/ScheduledTasksWebSocketListener.cs +++ b/MediaBrowser.Api/ScheduledTasks/ScheduledTasksWebSocketListener.cs @@ -1,4 +1,4 @@ -using MediaBrowser.Common.Kernel; +using MediaBrowser.Common.Net; using MediaBrowser.Common.ScheduledTasks; using MediaBrowser.Model.Logging; using MediaBrowser.Model.Tasks; diff --git a/MediaBrowser.Api/SystemService.cs b/MediaBrowser.Api/SystemService.cs index 96ed70b8f1..3fdf621c0f 100644 --- a/MediaBrowser.Api/SystemService.cs +++ b/MediaBrowser.Api/SystemService.cs @@ -1,11 +1,11 @@ using MediaBrowser.Common; using MediaBrowser.Common.Extensions; -using MediaBrowser.Common.Implementations.HttpServer; using MediaBrowser.Controller; using MediaBrowser.Controller.Configuration; using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Serialization; using MediaBrowser.Model.System; +using MediaBrowser.Server.Implementations.HttpServer; using ServiceStack.ServiceHost; using System; using System.IO; @@ -66,7 +66,7 @@ namespace MediaBrowser.Api /// <summary> /// The _app host /// </summary> - private readonly IApplicationHost _appHost; + private readonly IServerApplicationHost _appHost; /// <summary> /// The _configuration manager @@ -80,7 +80,7 @@ namespace MediaBrowser.Api /// <param name="appHost">The app host.</param> /// <param name="configurationManager">The configuration manager.</param> /// <exception cref="System.ArgumentNullException">jsonSerializer</exception> - public SystemService(IJsonSerializer jsonSerializer, IApplicationHost appHost, IServerConfigurationManager configurationManager) + public SystemService(IJsonSerializer jsonSerializer, IServerApplicationHost appHost, IServerConfigurationManager configurationManager) : base() { if (jsonSerializer == null) @@ -104,7 +104,7 @@ namespace MediaBrowser.Api /// <returns>System.Object.</returns> public object Get(GetSystemInfo request) { - var result = Kernel.Instance.GetSystemInfo(); + var result = _appHost.GetSystemInfo(); return ToOptimizedResult(result); } @@ -132,7 +132,7 @@ namespace MediaBrowser.Api Task.Run(async () => { await Task.Delay(100); - Kernel.Instance.PerformPendingRestart(); + _appHost.PerformPendingRestart(); }); } diff --git a/MediaBrowser.Api/UserLibrary/BaseItemsByNameService.cs b/MediaBrowser.Api/UserLibrary/BaseItemsByNameService.cs index e2dd0519ab..9d056c699b 100644 --- a/MediaBrowser.Api/UserLibrary/BaseItemsByNameService.cs +++ b/MediaBrowser.Api/UserLibrary/BaseItemsByNameService.cs @@ -1,8 +1,8 @@ -using MediaBrowser.Common.Implementations.HttpServer; -using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Entities; +using MediaBrowser.Server.Implementations.HttpServer; using ServiceStack.ServiceHost; using System; using System.Collections.Generic; diff --git a/MediaBrowser.Api/UserLibrary/ItemsService.cs b/MediaBrowser.Api/UserLibrary/ItemsService.cs index b89715d1c1..c2b01f9b0e 100644 --- a/MediaBrowser.Api/UserLibrary/ItemsService.cs +++ b/MediaBrowser.Api/UserLibrary/ItemsService.cs @@ -1,10 +1,9 @@ -using MediaBrowser.Common.Implementations.HttpServer; -using MediaBrowser.Controller; -using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities.Audio; using MediaBrowser.Controller.Library; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Entities; +using MediaBrowser.Server.Implementations.HttpServer; using ServiceStack.ServiceHost; using System; using System.Collections.Generic; diff --git a/MediaBrowser.Api/UserLibrary/UserLibraryService.cs b/MediaBrowser.Api/UserLibrary/UserLibraryService.cs index c40e599989..ca439b346c 100644 --- a/MediaBrowser.Api/UserLibrary/UserLibraryService.cs +++ b/MediaBrowser.Api/UserLibrary/UserLibraryService.cs @@ -1,12 +1,11 @@ -using MediaBrowser.Common.Implementations.HttpServer; -using MediaBrowser.Controller; -using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities.Movies; using MediaBrowser.Controller.Library; using MediaBrowser.Model.Connectivity; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Serialization; +using MediaBrowser.Server.Implementations.HttpServer; using ServiceStack.ServiceHost; using ServiceStack.Text.Controller; using System; diff --git a/MediaBrowser.Api/UserService.cs b/MediaBrowser.Api/UserService.cs index abf07f9244..d1606f954c 100644 --- a/MediaBrowser.Api/UserService.cs +++ b/MediaBrowser.Api/UserService.cs @@ -1,8 +1,8 @@ using MediaBrowser.Common.Extensions; -using MediaBrowser.Common.Implementations.HttpServer; using MediaBrowser.Controller.Library; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Serialization; +using MediaBrowser.Server.Implementations.HttpServer; using ServiceStack.ServiceHost; using ServiceStack.Text.Controller; using System; diff --git a/MediaBrowser.Api/WeatherService.cs b/MediaBrowser.Api/WeatherService.cs index d719511826..f2ba68113e 100644 --- a/MediaBrowser.Api/WeatherService.cs +++ b/MediaBrowser.Api/WeatherService.cs @@ -1,6 +1,6 @@ -using MediaBrowser.Common.Implementations.HttpServer; -using MediaBrowser.Controller; +using MediaBrowser.Controller; using MediaBrowser.Model.Weather; +using MediaBrowser.Server.Implementations.HttpServer; using ServiceStack.ServiceHost; using System.Linq; using System.Threading; diff --git a/MediaBrowser.Api/WebSocket/LogFileWebSocketListener.cs b/MediaBrowser.Api/WebSocket/LogFileWebSocketListener.cs index 2480b2af8b..f11bae5239 100644 --- a/MediaBrowser.Api/WebSocket/LogFileWebSocketListener.cs +++ b/MediaBrowser.Api/WebSocket/LogFileWebSocketListener.cs @@ -1,5 +1,5 @@ using MediaBrowser.Common.IO; -using MediaBrowser.Common.Kernel; +using MediaBrowser.Common.Net; using MediaBrowser.Model.Logging; using System; using System.Collections.Generic; diff --git a/MediaBrowser.Api/WebSocket/SystemInfoWebSocketListener.cs b/MediaBrowser.Api/WebSocket/SystemInfoWebSocketListener.cs index 40c3f2f247..ae8f41c363 100644 --- a/MediaBrowser.Api/WebSocket/SystemInfoWebSocketListener.cs +++ b/MediaBrowser.Api/WebSocket/SystemInfoWebSocketListener.cs @@ -1,4 +1,4 @@ -using MediaBrowser.Common.Kernel; +using MediaBrowser.Common.Net; using MediaBrowser.Controller; using MediaBrowser.Model.Logging; using MediaBrowser.Model.System; @@ -23,17 +23,16 @@ namespace MediaBrowser.Api.WebSocket /// <summary> /// The _kernel /// </summary> - private readonly IKernel _kernel; + private readonly IServerApplicationHost _appHost; /// <summary> /// Initializes a new instance of the <see cref="SystemInfoWebSocketListener" /> class. /// </summary> - /// <param name="kernel">The kernel.</param> /// <param name="logger">The logger.</param> - public SystemInfoWebSocketListener(Kernel kernel, ILogger logger) + public SystemInfoWebSocketListener(ILogger logger, IServerApplicationHost appHost) : base(logger) { - _kernel = kernel; + _appHost = appHost; } /// <summary> @@ -43,7 +42,7 @@ namespace MediaBrowser.Api.WebSocket /// <returns>Task{SystemInfo}.</returns> protected override Task<SystemInfo> GetDataToSend(object state) { - return Task.FromResult(_kernel.GetSystemInfo()); + return Task.FromResult(_appHost.GetSystemInfo()); } } } |
