mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-11-15 18:08:53 -07:00
move classes
This commit is contained in:
parent
f52373609e
commit
8ef442c2e8
@ -560,17 +560,19 @@ namespace Emby.Dlna
|
|||||||
? ImageFormat.Png
|
? ImageFormat.Png
|
||||||
: ImageFormat.Jpg;
|
: ImageFormat.Jpg;
|
||||||
|
|
||||||
|
var resource = GetType().Namespace + ".Images." + filename.ToLower();
|
||||||
|
|
||||||
#if NET46
|
#if NET46
|
||||||
return new ImageStream
|
return new ImageStream
|
||||||
{
|
{
|
||||||
Format = format,
|
Format = format,
|
||||||
Stream = GetType().Assembly.GetManifestResourceStream("MediaBrowser.Dlna.Images." + filename.ToLower())
|
Stream = GetType().Assembly.GetManifestResourceStream(resource)
|
||||||
};
|
};
|
||||||
#elif NETSTANDARD1_6
|
#elif NETSTANDARD1_6
|
||||||
return new ImageStream
|
return new ImageStream
|
||||||
{
|
{
|
||||||
Format = format,
|
Format = format,
|
||||||
Stream = GetType().GetTypeInfo().Assembly.GetManifestResourceStream("MediaBrowser.Dlna.Images." + filename.ToLower())
|
Stream = GetType().GetTypeInfo().Assembly.GetManifestResourceStream(resource)
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
|
@ -131,6 +131,8 @@
|
|||||||
<Compile Include="ScheduledTasks\RefreshIntrosTask.cs" />
|
<Compile Include="ScheduledTasks\RefreshIntrosTask.cs" />
|
||||||
<Compile Include="ScheduledTasks\RefreshMediaLibraryTask.cs" />
|
<Compile Include="ScheduledTasks\RefreshMediaLibraryTask.cs" />
|
||||||
<Compile Include="ScheduledTasks\SystemUpdateTask.cs" />
|
<Compile Include="ScheduledTasks\SystemUpdateTask.cs" />
|
||||||
|
<Compile Include="ServerManager\ServerManager.cs" />
|
||||||
|
<Compile Include="ServerManager\WebSocketConnection.cs" />
|
||||||
<Compile Include="Sorting\AiredEpisodeOrderComparer.cs" />
|
<Compile Include="Sorting\AiredEpisodeOrderComparer.cs" />
|
||||||
<Compile Include="Sorting\AirTimeComparer.cs" />
|
<Compile Include="Sorting\AirTimeComparer.cs" />
|
||||||
<Compile Include="Sorting\AlbumArtistComparer.cs" />
|
<Compile Include="Sorting\AlbumArtistComparer.cs" />
|
||||||
@ -178,6 +180,7 @@
|
|||||||
<Compile Include="Sync\SyncNotificationEntryPoint.cs" />
|
<Compile Include="Sync\SyncNotificationEntryPoint.cs" />
|
||||||
<Compile Include="Sync\SyncRegistrationInfo.cs" />
|
<Compile Include="Sync\SyncRegistrationInfo.cs" />
|
||||||
<Compile Include="Sync\TargetDataProvider.cs" />
|
<Compile Include="Sync\TargetDataProvider.cs" />
|
||||||
|
<Compile Include="TV\SeriesPostScanTask.cs" />
|
||||||
<Compile Include="TV\TVSeriesManager.cs" />
|
<Compile Include="TV\TVSeriesManager.cs" />
|
||||||
<Compile Include="Updates\InstallationManager.cs" />
|
<Compile Include="Updates\InstallationManager.cs" />
|
||||||
<Compile Include="UserViews\CollectionFolderImageProvider.cs" />
|
<Compile Include="UserViews\CollectionFolderImageProvider.cs" />
|
||||||
@ -197,6 +200,10 @@
|
|||||||
<Project>{7eeeb4bb-f3e8-48fc-b4c5-70f0fff8329b}</Project>
|
<Project>{7eeeb4bb-f3e8-48fc-b4c5-70f0fff8329b}</Project>
|
||||||
<Name>MediaBrowser.Model</Name>
|
<Name>MediaBrowser.Model</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\MediaBrowser.Providers\MediaBrowser.Providers.csproj">
|
||||||
|
<Project>{442b5058-dcaf-4263-bb6a-f21e31120a1b}</Project>
|
||||||
|
<Name>MediaBrowser.Providers</Name>
|
||||||
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
|
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
|
@ -10,14 +10,14 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Specialized;
|
using System.Collections.Specialized;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net.Sockets;
|
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using MediaBrowser.Common.IO;
|
using MediaBrowser.Common.IO;
|
||||||
using MediaBrowser.Model.IO;
|
using MediaBrowser.Model.IO;
|
||||||
using MediaBrowser.Model.Services;
|
using MediaBrowser.Model.Services;
|
||||||
|
using MediaBrowser.Model.TextEncoding;
|
||||||
|
|
||||||
namespace MediaBrowser.Server.Implementations.ServerManager
|
namespace Emby.Server.Implementations.ServerManager
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Manages the Http Server, Udp Server and WebSocket connections
|
/// Manages the Http Server, Udp Server and WebSocket connections
|
||||||
@ -76,6 +76,7 @@ namespace MediaBrowser.Server.Implementations.ServerManager
|
|||||||
|
|
||||||
private bool _disposed;
|
private bool _disposed;
|
||||||
private readonly IMemoryStreamProvider _memoryStreamProvider;
|
private readonly IMemoryStreamProvider _memoryStreamProvider;
|
||||||
|
private readonly IEncoding _textEncoding;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="ServerManager" /> class.
|
/// Initializes a new instance of the <see cref="ServerManager" /> class.
|
||||||
@ -85,7 +86,7 @@ namespace MediaBrowser.Server.Implementations.ServerManager
|
|||||||
/// <param name="logger">The logger.</param>
|
/// <param name="logger">The logger.</param>
|
||||||
/// <param name="configurationManager">The configuration manager.</param>
|
/// <param name="configurationManager">The configuration manager.</param>
|
||||||
/// <exception cref="System.ArgumentNullException">applicationHost</exception>
|
/// <exception cref="System.ArgumentNullException">applicationHost</exception>
|
||||||
public ServerManager(IServerApplicationHost applicationHost, IJsonSerializer jsonSerializer, ILogger logger, IServerConfigurationManager configurationManager, IMemoryStreamProvider memoryStreamProvider)
|
public ServerManager(IServerApplicationHost applicationHost, IJsonSerializer jsonSerializer, ILogger logger, IServerConfigurationManager configurationManager, IMemoryStreamProvider memoryStreamProvider, IEncoding textEncoding)
|
||||||
{
|
{
|
||||||
if (applicationHost == null)
|
if (applicationHost == null)
|
||||||
{
|
{
|
||||||
@ -105,6 +106,7 @@ namespace MediaBrowser.Server.Implementations.ServerManager
|
|||||||
_applicationHost = applicationHost;
|
_applicationHost = applicationHost;
|
||||||
ConfigurationManager = configurationManager;
|
ConfigurationManager = configurationManager;
|
||||||
_memoryStreamProvider = memoryStreamProvider;
|
_memoryStreamProvider = memoryStreamProvider;
|
||||||
|
_textEncoding = textEncoding;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -127,15 +129,13 @@ namespace MediaBrowser.Server.Implementations.ServerManager
|
|||||||
HttpServer = _applicationHost.Resolve<IHttpServer>();
|
HttpServer = _applicationHost.Resolve<IHttpServer>();
|
||||||
HttpServer.StartServer(urlPrefixes, certificatePath);
|
HttpServer.StartServer(urlPrefixes, certificatePath);
|
||||||
}
|
}
|
||||||
catch (SocketException ex)
|
|
||||||
{
|
|
||||||
_logger.ErrorException("The http server is unable to start due to a Socket error. This can occasionally happen when the operating system takes longer than usual to release the IP bindings from the previous session. This can take up to five minutes. Please try waiting or rebooting the system.", ex);
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.ErrorException("Error starting Http Server", ex);
|
var msg = string.Equals(ex.GetType().Name, "SocketException", StringComparison.OrdinalIgnoreCase)
|
||||||
|
? "The http server is unable to start due to a Socket error. This can occasionally happen when the operating system takes longer than usual to release the IP bindings from the previous session. This can take up to five minutes. Please try waiting or rebooting the system."
|
||||||
|
: "Error starting Http Server";
|
||||||
|
|
||||||
|
_logger.ErrorException(msg, ex);
|
||||||
|
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
@ -155,7 +155,7 @@ namespace MediaBrowser.Server.Implementations.ServerManager
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var connection = new WebSocketConnection(e.WebSocket, e.Endpoint, _jsonSerializer, _logger, _memoryStreamProvider)
|
var connection = new WebSocketConnection(e.WebSocket, e.Endpoint, _jsonSerializer, _logger, _memoryStreamProvider, _textEncoding)
|
||||||
{
|
{
|
||||||
OnReceive = ProcessWebSocketMessageReceived,
|
OnReceive = ProcessWebSocketMessageReceived,
|
||||||
Url = e.Url,
|
Url = e.Url,
|
@ -12,9 +12,10 @@ using System.Threading.Tasks;
|
|||||||
using MediaBrowser.Common.IO;
|
using MediaBrowser.Common.IO;
|
||||||
using MediaBrowser.Model.IO;
|
using MediaBrowser.Model.IO;
|
||||||
using MediaBrowser.Model.Services;
|
using MediaBrowser.Model.Services;
|
||||||
|
using MediaBrowser.Model.TextEncoding;
|
||||||
using UniversalDetector;
|
using UniversalDetector;
|
||||||
|
|
||||||
namespace MediaBrowser.Server.Implementations.ServerManager
|
namespace Emby.Server.Implementations.ServerManager
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class WebSocketConnection
|
/// Class WebSocketConnection
|
||||||
@ -77,6 +78,7 @@ namespace MediaBrowser.Server.Implementations.ServerManager
|
|||||||
/// <value>The query string.</value>
|
/// <value>The query string.</value>
|
||||||
public QueryParamCollection QueryString { get; set; }
|
public QueryParamCollection QueryString { get; set; }
|
||||||
private readonly IMemoryStreamProvider _memoryStreamProvider;
|
private readonly IMemoryStreamProvider _memoryStreamProvider;
|
||||||
|
private readonly IEncoding _textEncoding;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="WebSocketConnection" /> class.
|
/// Initializes a new instance of the <see cref="WebSocketConnection" /> class.
|
||||||
@ -86,7 +88,7 @@ namespace MediaBrowser.Server.Implementations.ServerManager
|
|||||||
/// <param name="jsonSerializer">The json serializer.</param>
|
/// <param name="jsonSerializer">The json serializer.</param>
|
||||||
/// <param name="logger">The logger.</param>
|
/// <param name="logger">The logger.</param>
|
||||||
/// <exception cref="System.ArgumentNullException">socket</exception>
|
/// <exception cref="System.ArgumentNullException">socket</exception>
|
||||||
public WebSocketConnection(IWebSocket socket, string remoteEndPoint, IJsonSerializer jsonSerializer, ILogger logger, IMemoryStreamProvider memoryStreamProvider)
|
public WebSocketConnection(IWebSocket socket, string remoteEndPoint, IJsonSerializer jsonSerializer, ILogger logger, IMemoryStreamProvider memoryStreamProvider, IEncoding textEncoding)
|
||||||
{
|
{
|
||||||
if (socket == null)
|
if (socket == null)
|
||||||
{
|
{
|
||||||
@ -113,6 +115,7 @@ namespace MediaBrowser.Server.Implementations.ServerManager
|
|||||||
RemoteEndPoint = remoteEndPoint;
|
RemoteEndPoint = remoteEndPoint;
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
_memoryStreamProvider = memoryStreamProvider;
|
_memoryStreamProvider = memoryStreamProvider;
|
||||||
|
_textEncoding = textEncoding;
|
||||||
|
|
||||||
socket.Closed += socket_Closed;
|
socket.Closed += socket_Closed;
|
||||||
}
|
}
|
||||||
@ -138,11 +141,11 @@ namespace MediaBrowser.Server.Implementations.ServerManager
|
|||||||
|
|
||||||
if (string.Equals(charset, "utf-8", StringComparison.OrdinalIgnoreCase))
|
if (string.Equals(charset, "utf-8", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
OnReceiveInternal(Encoding.UTF8.GetString(bytes));
|
OnReceiveInternal(Encoding.UTF8.GetString(bytes, 0, bytes.Length));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
OnReceiveInternal(Encoding.ASCII.GetString(bytes));
|
OnReceiveInternal(_textEncoding.GetASCIIString(bytes, 0, bytes.Length));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private string DetectCharset(byte[] bytes)
|
private string DetectCharset(byte[] bytes)
|
@ -14,10 +14,11 @@ using MediaBrowser.Model.Globalization;
|
|||||||
using MediaBrowser.Model.IO;
|
using MediaBrowser.Model.IO;
|
||||||
using MediaBrowser.Model.Logging;
|
using MediaBrowser.Model.Logging;
|
||||||
using MediaBrowser.Model.Tasks;
|
using MediaBrowser.Model.Tasks;
|
||||||
|
using MediaBrowser.Model.Threading;
|
||||||
using MediaBrowser.Model.Xml;
|
using MediaBrowser.Model.Xml;
|
||||||
using MediaBrowser.Providers.TV;
|
using MediaBrowser.Providers.TV;
|
||||||
|
|
||||||
namespace MediaBrowser.Server.Implementations.TV
|
namespace Emby.Server.Implementations.TV
|
||||||
{
|
{
|
||||||
class SeriesGroup : List<Series>, IGrouping<string, Series>
|
class SeriesGroup : List<Series>, IGrouping<string, Series>
|
||||||
{
|
{
|
||||||
@ -132,8 +133,9 @@ namespace MediaBrowser.Server.Implementations.TV
|
|||||||
private const int LibraryUpdateDuration = 180000;
|
private const int LibraryUpdateDuration = 180000;
|
||||||
private readonly ITaskManager _taskManager;
|
private readonly ITaskManager _taskManager;
|
||||||
private readonly IXmlReaderSettingsFactory _xmlSettings;
|
private readonly IXmlReaderSettingsFactory _xmlSettings;
|
||||||
|
private readonly ITimerFactory _timerFactory;
|
||||||
|
|
||||||
public CleanMissingEpisodesEntryPoint(ILibraryManager libraryManager, IServerConfigurationManager config, ILogger logger, ILocalizationManager localization, IFileSystem fileSystem, ITaskManager taskManager, IXmlReaderSettingsFactory xmlSettings)
|
public CleanMissingEpisodesEntryPoint(ILibraryManager libraryManager, IServerConfigurationManager config, ILogger logger, ILocalizationManager localization, IFileSystem fileSystem, ITaskManager taskManager, IXmlReaderSettingsFactory xmlSettings, ITimerFactory timerFactory)
|
||||||
{
|
{
|
||||||
_libraryManager = libraryManager;
|
_libraryManager = libraryManager;
|
||||||
_config = config;
|
_config = config;
|
||||||
@ -142,9 +144,10 @@ namespace MediaBrowser.Server.Implementations.TV
|
|||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
_taskManager = taskManager;
|
_taskManager = taskManager;
|
||||||
_xmlSettings = xmlSettings;
|
_xmlSettings = xmlSettings;
|
||||||
|
_timerFactory = timerFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Timer LibraryUpdateTimer { get; set; }
|
private ITimer LibraryUpdateTimer { get; set; }
|
||||||
|
|
||||||
public void Run()
|
public void Run()
|
||||||
{
|
{
|
||||||
@ -162,7 +165,7 @@ namespace MediaBrowser.Server.Implementations.TV
|
|||||||
{
|
{
|
||||||
if (LibraryUpdateTimer == null)
|
if (LibraryUpdateTimer == null)
|
||||||
{
|
{
|
||||||
LibraryUpdateTimer = new Timer(LibraryUpdateTimerCallback, null, LibraryUpdateDuration, Timeout.Infinite);
|
LibraryUpdateTimer = _timerFactory.Create(LibraryUpdateTimerCallback, null, LibraryUpdateDuration, Timeout.Infinite);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
@ -1,7 +1,8 @@
|
|||||||
{
|
{
|
||||||
"supports": {},
|
"supports": {},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"MediaBrowser.Naming": "1.0.0.59"
|
"MediaBrowser.Naming": "1.0.0.59",
|
||||||
|
"UniversalDetector": "1.0.1"
|
||||||
},
|
},
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
".NETPortable,Version=v4.5,Profile=Profile7": {}
|
".NETPortable,Version=v4.5,Profile=Profile7": {}
|
||||||
|
@ -14,13 +14,13 @@ using System.Threading.Tasks;
|
|||||||
using MediaBrowser.Common.IO;
|
using MediaBrowser.Common.IO;
|
||||||
using MediaBrowser.Controller.IO;
|
using MediaBrowser.Controller.IO;
|
||||||
using MediaBrowser.Model.IO;
|
using MediaBrowser.Model.IO;
|
||||||
using MediaBrowser.Server.Implementations.Threading;
|
using MediaBrowser.Model.Threading;
|
||||||
|
|
||||||
namespace MediaBrowser.Server.Implementations.Connect
|
namespace MediaBrowser.Server.Implementations.Connect
|
||||||
{
|
{
|
||||||
public class ConnectEntryPoint : IServerEntryPoint
|
public class ConnectEntryPoint : IServerEntryPoint
|
||||||
{
|
{
|
||||||
private PeriodicTimer _timer;
|
private ITimer _timer;
|
||||||
private readonly IHttpClient _httpClient;
|
private readonly IHttpClient _httpClient;
|
||||||
private readonly IApplicationPaths _appPaths;
|
private readonly IApplicationPaths _appPaths;
|
||||||
private readonly ILogger _logger;
|
private readonly ILogger _logger;
|
||||||
@ -29,8 +29,9 @@ namespace MediaBrowser.Server.Implementations.Connect
|
|||||||
private readonly INetworkManager _networkManager;
|
private readonly INetworkManager _networkManager;
|
||||||
private readonly IApplicationHost _appHost;
|
private readonly IApplicationHost _appHost;
|
||||||
private readonly IFileSystem _fileSystem;
|
private readonly IFileSystem _fileSystem;
|
||||||
|
private readonly ITimerFactory _timerFactory;
|
||||||
|
|
||||||
public ConnectEntryPoint(IHttpClient httpClient, IApplicationPaths appPaths, ILogger logger, INetworkManager networkManager, IConnectManager connectManager, IApplicationHost appHost, IFileSystem fileSystem)
|
public ConnectEntryPoint(IHttpClient httpClient, IApplicationPaths appPaths, ILogger logger, INetworkManager networkManager, IConnectManager connectManager, IApplicationHost appHost, IFileSystem fileSystem, ITimerFactory timerFactory)
|
||||||
{
|
{
|
||||||
_httpClient = httpClient;
|
_httpClient = httpClient;
|
||||||
_appPaths = appPaths;
|
_appPaths = appPaths;
|
||||||
@ -39,13 +40,14 @@ namespace MediaBrowser.Server.Implementations.Connect
|
|||||||
_connectManager = connectManager;
|
_connectManager = connectManager;
|
||||||
_appHost = appHost;
|
_appHost = appHost;
|
||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
|
_timerFactory = timerFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Run()
|
public void Run()
|
||||||
{
|
{
|
||||||
LoadCachedAddress();
|
LoadCachedAddress();
|
||||||
|
|
||||||
_timer = new PeriodicTimer(TimerCallback, null, TimeSpan.FromSeconds(5), TimeSpan.FromHours(1));
|
_timer = _timerFactory.Create(TimerCallback, null, TimeSpan.FromSeconds(5), TimeSpan.FromHours(1));
|
||||||
((ConnectManager)_connectManager).Start();
|
((ConnectManager)_connectManager).Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ using System.Net;
|
|||||||
using MediaBrowser.Common.Net;
|
using MediaBrowser.Common.Net;
|
||||||
using MediaBrowser.Model.Dlna;
|
using MediaBrowser.Model.Dlna;
|
||||||
using MediaBrowser.Model.Events;
|
using MediaBrowser.Model.Events;
|
||||||
using MediaBrowser.Server.Implementations.Threading;
|
using MediaBrowser.Model.Threading;
|
||||||
|
|
||||||
namespace MediaBrowser.Server.Implementations.EntryPoints
|
namespace MediaBrowser.Server.Implementations.EntryPoints
|
||||||
{
|
{
|
||||||
@ -23,16 +23,18 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
|
|||||||
private readonly IServerConfigurationManager _config;
|
private readonly IServerConfigurationManager _config;
|
||||||
private readonly IDeviceDiscovery _deviceDiscovery;
|
private readonly IDeviceDiscovery _deviceDiscovery;
|
||||||
|
|
||||||
private PeriodicTimer _timer;
|
private ITimer _timer;
|
||||||
private bool _isStarted;
|
private bool _isStarted;
|
||||||
|
private readonly ITimerFactory _timerFactory;
|
||||||
|
|
||||||
public ExternalPortForwarding(ILogManager logmanager, IServerApplicationHost appHost, IServerConfigurationManager config, IDeviceDiscovery deviceDiscovery, IHttpClient httpClient)
|
public ExternalPortForwarding(ILogManager logmanager, IServerApplicationHost appHost, IServerConfigurationManager config, IDeviceDiscovery deviceDiscovery, IHttpClient httpClient, ITimerFactory timerFactory)
|
||||||
{
|
{
|
||||||
_logger = logmanager.GetLogger("PortMapper");
|
_logger = logmanager.GetLogger("PortMapper");
|
||||||
_appHost = appHost;
|
_appHost = appHost;
|
||||||
_config = config;
|
_config = config;
|
||||||
_deviceDiscovery = deviceDiscovery;
|
_deviceDiscovery = deviceDiscovery;
|
||||||
_httpClient = httpClient;
|
_httpClient = httpClient;
|
||||||
|
_timerFactory = timerFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string _lastConfigIdentifier;
|
private string _lastConfigIdentifier;
|
||||||
@ -94,7 +96,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
|
|||||||
|
|
||||||
NatUtility.StartDiscovery();
|
NatUtility.StartDiscovery();
|
||||||
|
|
||||||
_timer = new PeriodicTimer(ClearCreatedRules, null, TimeSpan.FromMinutes(5), TimeSpan.FromMinutes(5));
|
_timer = _timerFactory.Create(ClearCreatedRules, null, TimeSpan.FromMinutes(5), TimeSpan.FromMinutes(5));
|
||||||
|
|
||||||
_deviceDiscovery.DeviceDiscovered += _deviceDiscovery_DeviceDiscovered;
|
_deviceDiscovery.DeviceDiscovered += _deviceDiscovery_DeviceDiscovered;
|
||||||
|
|
||||||
|
@ -207,8 +207,6 @@
|
|||||||
<Compile Include="Serialization\JsonSerializer.cs" />
|
<Compile Include="Serialization\JsonSerializer.cs" />
|
||||||
<Compile Include="Social\SharingManager.cs" />
|
<Compile Include="Social\SharingManager.cs" />
|
||||||
<Compile Include="Social\SharingRepository.cs" />
|
<Compile Include="Social\SharingRepository.cs" />
|
||||||
<Compile Include="Threading\PeriodicTimer.cs" />
|
|
||||||
<Compile Include="TV\SeriesPostScanTask.cs" />
|
|
||||||
<Compile Include="Persistence\SqliteFileOrganizationRepository.cs" />
|
<Compile Include="Persistence\SqliteFileOrganizationRepository.cs" />
|
||||||
<Compile Include="Notifications\SqliteNotificationsRepository.cs" />
|
<Compile Include="Notifications\SqliteNotificationsRepository.cs" />
|
||||||
<Compile Include="Persistence\TypeMapper.cs" />
|
<Compile Include="Persistence\TypeMapper.cs" />
|
||||||
@ -217,8 +215,6 @@
|
|||||||
<Compile Include="Security\AuthenticationRepository.cs" />
|
<Compile Include="Security\AuthenticationRepository.cs" />
|
||||||
<Compile Include="Security\EncryptionManager.cs" />
|
<Compile Include="Security\EncryptionManager.cs" />
|
||||||
<Compile Include="ServerApplicationPaths.cs" />
|
<Compile Include="ServerApplicationPaths.cs" />
|
||||||
<Compile Include="ServerManager\ServerManager.cs" />
|
|
||||||
<Compile Include="ServerManager\WebSocketConnection.cs" />
|
|
||||||
<Compile Include="Session\HttpSessionController.cs" />
|
<Compile Include="Session\HttpSessionController.cs" />
|
||||||
<Compile Include="Session\SessionManager.cs">
|
<Compile Include="Session\SessionManager.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
|
@ -62,7 +62,6 @@ using MediaBrowser.Server.Implementations.Localization;
|
|||||||
using MediaBrowser.Server.Implementations.Notifications;
|
using MediaBrowser.Server.Implementations.Notifications;
|
||||||
using MediaBrowser.Server.Implementations.Persistence;
|
using MediaBrowser.Server.Implementations.Persistence;
|
||||||
using MediaBrowser.Server.Implementations.Security;
|
using MediaBrowser.Server.Implementations.Security;
|
||||||
using MediaBrowser.Server.Implementations.ServerManager;
|
|
||||||
using MediaBrowser.Server.Implementations.Session;
|
using MediaBrowser.Server.Implementations.Session;
|
||||||
using MediaBrowser.Server.Implementations.Social;
|
using MediaBrowser.Server.Implementations.Social;
|
||||||
using MediaBrowser.Server.Implementations.Sync;
|
using MediaBrowser.Server.Implementations.Sync;
|
||||||
@ -113,6 +112,7 @@ using Emby.Server.Implementations.MediaEncoder;
|
|||||||
using Emby.Server.Implementations.Notifications;
|
using Emby.Server.Implementations.Notifications;
|
||||||
using Emby.Server.Implementations.Persistence;
|
using Emby.Server.Implementations.Persistence;
|
||||||
using Emby.Server.Implementations.Playlists;
|
using Emby.Server.Implementations.Playlists;
|
||||||
|
using Emby.Server.Implementations.ServerManager;
|
||||||
using Emby.Server.Implementations.Sync;
|
using Emby.Server.Implementations.Sync;
|
||||||
using Emby.Server.Implementations.TV;
|
using Emby.Server.Implementations.TV;
|
||||||
using Emby.Server.Implementations.Updates;
|
using Emby.Server.Implementations.Updates;
|
||||||
@ -603,7 +603,7 @@ namespace MediaBrowser.Server.Startup.Common
|
|||||||
RegisterSingleInstance(HttpServer, false);
|
RegisterSingleInstance(HttpServer, false);
|
||||||
progress.Report(10);
|
progress.Report(10);
|
||||||
|
|
||||||
ServerManager = new ServerManager(this, JsonSerializer, LogManager.GetLogger("ServerManager"), ServerConfigurationManager, MemoryStreamProvider);
|
ServerManager = new ServerManager(this, JsonSerializer, LogManager.GetLogger("ServerManager"), ServerConfigurationManager, MemoryStreamProvider, textEncoding);
|
||||||
RegisterSingleInstance(ServerManager);
|
RegisterSingleInstance(ServerManager);
|
||||||
|
|
||||||
var innerProgress = new ActionableProgress<double>();
|
var innerProgress = new ActionableProgress<double>();
|
||||||
|
@ -4,7 +4,7 @@ using MediaBrowser.Controller.Session;
|
|||||||
using MediaBrowser.Model.Logging;
|
using MediaBrowser.Model.Logging;
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using MediaBrowser.Server.Implementations.Threading;
|
using MediaBrowser.Server.Startup.Common.Threading;
|
||||||
|
|
||||||
namespace MediaBrowser.Server.Startup.Common.EntryPoints
|
namespace MediaBrowser.Server.Startup.Common.EntryPoints
|
||||||
{
|
{
|
||||||
|
@ -95,6 +95,7 @@
|
|||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="StartupOptions.cs" />
|
<Compile Include="StartupOptions.cs" />
|
||||||
<Compile Include="SystemEvents.cs" />
|
<Compile Include="SystemEvents.cs" />
|
||||||
|
<Compile Include="Threading\PeriodicTimer.cs" />
|
||||||
<Compile Include="UnhandledExceptionWriter.cs" />
|
<Compile Include="UnhandledExceptionWriter.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
|
|
||||||
namespace MediaBrowser.Server.Implementations.Threading
|
namespace MediaBrowser.Server.Startup.Common.Threading
|
||||||
{
|
{
|
||||||
public class PeriodicTimer : IDisposable
|
public class PeriodicTimer : IDisposable
|
||||||
{
|
{
|
||||||
@ -46,13 +46,13 @@ namespace MediaBrowser.Server.Implementations.Threading
|
|||||||
{
|
{
|
||||||
_timer = new Timer(TimerCallback, _state, dueTime, _period);
|
_timer = new Timer(TimerCallback, _state, dueTime, _period);
|
||||||
|
|
||||||
SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;
|
Microsoft.Win32.SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DisposeTimer()
|
private void DisposeTimer()
|
||||||
{
|
{
|
||||||
SystemEvents.PowerModeChanged -= SystemEvents_PowerModeChanged;
|
Microsoft.Win32.SystemEvents.PowerModeChanged -= SystemEvents_PowerModeChanged;
|
||||||
|
|
||||||
lock (_timerLock)
|
lock (_timerLock)
|
||||||
{
|
{
|
Loading…
Reference in New Issue
Block a user