aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/EntryPoints
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Server.Implementations/EntryPoints')
-rw-r--r--Emby.Server.Implementations/EntryPoints/AutomaticRestartEntryPoint.cs12
-rw-r--r--Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs16
-rw-r--r--Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs16
-rw-r--r--Emby.Server.Implementations/EntryPoints/RecordingNotifier.cs2
-rw-r--r--Emby.Server.Implementations/EntryPoints/RefreshUsersMetadata.cs8
-rw-r--r--Emby.Server.Implementations/EntryPoints/ServerEventNotifier.cs11
-rw-r--r--Emby.Server.Implementations/EntryPoints/StartupWizard.cs4
-rw-r--r--Emby.Server.Implementations/EntryPoints/SystemEvents.cs11
-rw-r--r--Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs8
-rw-r--r--Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.cs18
10 files changed, 45 insertions, 61 deletions
diff --git a/Emby.Server.Implementations/EntryPoints/AutomaticRestartEntryPoint.cs b/Emby.Server.Implementations/EntryPoints/AutomaticRestartEntryPoint.cs
index a0947c87d..0fc4c3858 100644
--- a/Emby.Server.Implementations/EntryPoints/AutomaticRestartEntryPoint.cs
+++ b/Emby.Server.Implementations/EntryPoints/AutomaticRestartEntryPoint.cs
@@ -1,16 +1,16 @@
-using MediaBrowser.Controller;
-using MediaBrowser.Controller.Configuration;
-using MediaBrowser.Controller.Plugins;
-using MediaBrowser.Controller.Session;
-using Microsoft.Extensions.Logging;
-using MediaBrowser.Model.Tasks;
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
+using MediaBrowser.Controller;
+using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.LiveTv;
+using MediaBrowser.Controller.Plugins;
+using MediaBrowser.Controller.Session;
using MediaBrowser.Model.LiveTv;
+using MediaBrowser.Model.Tasks;
using MediaBrowser.Model.Threading;
+using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.EntryPoints
{
diff --git a/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs b/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs
index 6c658a695..8755ee3a7 100644
--- a/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs
+++ b/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs
@@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using System.Globalization;
using System.Net;
+using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller;
@@ -9,10 +10,9 @@ using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Plugins;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Events;
-using Microsoft.Extensions.Logging;
using MediaBrowser.Model.Threading;
+using Microsoft.Extensions.Logging;
using Mono.Nat;
-using System.Threading;
namespace Emby.Server.Implementations.EntryPoints
{
@@ -108,11 +108,9 @@ namespace Emby.Server.Implementations.EntryPoints
var info = e.Argument;
- string usn;
- if (!info.Headers.TryGetValue("USN", out usn)) usn = string.Empty;
+ if (!info.Headers.TryGetValue("USN", out string usn)) usn = string.Empty;
- string nt;
- if (!info.Headers.TryGetValue("NT", out nt)) nt = string.Empty;
+ if (!info.Headers.TryGetValue("NT", out string nt)) nt = string.Empty;
// Filter device type
if (usn.IndexOf("WANIPConnection:", StringComparison.OrdinalIgnoreCase) == -1 &&
@@ -141,8 +139,7 @@ namespace Emby.Server.Implementations.EntryPoints
_logger.LogDebug("Found NAT device: " + identifier);
- IPAddress address;
- if (IPAddress.TryParse(info.Location.Host, out address))
+ if (IPAddress.TryParse(info.Location.Host, out var address))
{
// The Handle method doesn't need the port
var endpoint = new IPEndPoint(address, info.Location.Port);
@@ -153,8 +150,7 @@ namespace Emby.Server.Implementations.EntryPoints
{
var localAddressString = await _appHost.GetLocalApiUrl(CancellationToken.None).ConfigureAwait(false);
- Uri uri;
- if (Uri.TryCreate(localAddressString, UriKind.Absolute, out uri))
+ if (Uri.TryCreate(localAddressString, UriKind.Absolute, out var uri))
{
localAddressString = uri.Host;
diff --git a/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs b/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs
index a5c907213..7a8b09cf7 100644
--- a/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs
+++ b/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs
@@ -1,21 +1,20 @@
-using MediaBrowser.Controller.Entities;
-using MediaBrowser.Controller.Library;
-using MediaBrowser.Controller.Plugins;
-using MediaBrowser.Controller.Session;
-using MediaBrowser.Model.Entities;
-using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Threading;
using MediaBrowser.Controller.Channels;
+using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Audio;
-using MediaBrowser.Controller.Entities.TV;
+using MediaBrowser.Controller.Library;
+using MediaBrowser.Controller.Plugins;
using MediaBrowser.Controller.Providers;
+using MediaBrowser.Controller.Session;
+using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Events;
using MediaBrowser.Model.Extensions;
using MediaBrowser.Model.Threading;
+using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.EntryPoints
{
@@ -90,8 +89,7 @@ namespace Emby.Server.Implementations.EntryPoints
var progress = e.Argument.Item2;
- DateTime lastMessageSendTime;
- if (_lastProgressMessageTimes.TryGetValue(item.Id, out lastMessageSendTime))
+ if (_lastProgressMessageTimes.TryGetValue(item.Id, out var lastMessageSendTime))
{
if (progress > 0 && progress < 100 && (DateTime.UtcNow - lastMessageSendTime).TotalMilliseconds < 1000)
{
diff --git a/Emby.Server.Implementations/EntryPoints/RecordingNotifier.cs b/Emby.Server.Implementations/EntryPoints/RecordingNotifier.cs
index c7bd03960..e37ea96a1 100644
--- a/Emby.Server.Implementations/EntryPoints/RecordingNotifier.cs
+++ b/Emby.Server.Implementations/EntryPoints/RecordingNotifier.cs
@@ -58,7 +58,7 @@ namespace Emby.Server.Implementations.EntryPoints
try
{
- await _sessionManager.SendMessageToUserSessions<TimerEventInfo>(users, name, info, CancellationToken.None);
+ await _sessionManager.SendMessageToUserSessions(users, name, info, CancellationToken.None);
}
catch (ObjectDisposedException)
{
diff --git a/Emby.Server.Implementations/EntryPoints/RefreshUsersMetadata.cs b/Emby.Server.Implementations/EntryPoints/RefreshUsersMetadata.cs
index f0b834ccb..b7565adec 100644
--- a/Emby.Server.Implementations/EntryPoints/RefreshUsersMetadata.cs
+++ b/Emby.Server.Implementations/EntryPoints/RefreshUsersMetadata.cs
@@ -1,12 +1,12 @@
-using System;
-using MediaBrowser.Controller.Library;
-using System.Threading;
-using MediaBrowser.Model.Tasks;
+using System;
using System.Collections.Generic;
using System.Linq;
+using System.Threading;
using System.Threading.Tasks;
+using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.IO;
+using MediaBrowser.Model.Tasks;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.EntryPoints
diff --git a/Emby.Server.Implementations/EntryPoints/ServerEventNotifier.cs b/Emby.Server.Implementations/EntryPoints/ServerEventNotifier.cs
index 72dcabab3..92ea3a8f4 100644
--- a/Emby.Server.Implementations/EntryPoints/ServerEventNotifier.cs
+++ b/Emby.Server.Implementations/EntryPoints/ServerEventNotifier.cs
@@ -1,17 +1,14 @@
-using MediaBrowser.Common.Plugins;
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using MediaBrowser.Common.Plugins;
using MediaBrowser.Common.Updates;
using MediaBrowser.Controller;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
-using MediaBrowser.Controller.Net;
using MediaBrowser.Controller.Plugins;
using MediaBrowser.Controller.Session;
-using MediaBrowser.Controller.Sync;
using MediaBrowser.Model.Events;
-using MediaBrowser.Model.Sync;
-using System;
-using System.Collections.Generic;
-using System.Threading;
using MediaBrowser.Model.Tasks;
namespace Emby.Server.Implementations.EntryPoints
diff --git a/Emby.Server.Implementations/EntryPoints/StartupWizard.cs b/Emby.Server.Implementations/EntryPoints/StartupWizard.cs
index ffd98bf78..05c8b07ab 100644
--- a/Emby.Server.Implementations/EntryPoints/StartupWizard.cs
+++ b/Emby.Server.Implementations/EntryPoints/StartupWizard.cs
@@ -1,8 +1,8 @@
-using Emby.Server.Implementations.Browser;
+using Emby.Server.Implementations.Browser;
using MediaBrowser.Controller;
+using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Plugins;
using Microsoft.Extensions.Logging;
-using MediaBrowser.Controller.Configuration;
namespace Emby.Server.Implementations.EntryPoints
{
diff --git a/Emby.Server.Implementations/EntryPoints/SystemEvents.cs b/Emby.Server.Implementations/EntryPoints/SystemEvents.cs
index e27de8967..72c8acd9f 100644
--- a/Emby.Server.Implementations/EntryPoints/SystemEvents.cs
+++ b/Emby.Server.Implementations/EntryPoints/SystemEvents.cs
@@ -1,12 +1,7 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using MediaBrowser.Model.System;
-using MediaBrowser.Controller.Plugins;
-using MediaBrowser.Common;
+using System;
using MediaBrowser.Controller;
+using MediaBrowser.Controller.Plugins;
+using MediaBrowser.Model.System;
namespace Emby.Server.Implementations.EntryPoints
{
diff --git a/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs b/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs
index 730ced055..2c8246d13 100644
--- a/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs
+++ b/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs
@@ -1,10 +1,10 @@
-using System;
+using System;
+using Emby.Server.Implementations.Udp;
using MediaBrowser.Controller;
using MediaBrowser.Controller.Plugins;
-using Microsoft.Extensions.Logging;
-using MediaBrowser.Model.Serialization;
-using Emby.Server.Implementations.Udp;
using MediaBrowser.Model.Net;
+using MediaBrowser.Model.Serialization;
+using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.EntryPoints
{
diff --git a/Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.cs b/Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.cs
index 58309ea1c..9e71ffceb 100644
--- a/Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.cs
+++ b/Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.cs
@@ -1,17 +1,17 @@
-using MediaBrowser.Controller.Entities;
-using MediaBrowser.Controller.Library;
-using MediaBrowser.Controller.Plugins;
-using MediaBrowser.Controller.Session;
-using MediaBrowser.Model.Entities;
-using Microsoft.Extensions.Logging;
-using MediaBrowser.Model.Session;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
+using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.Library;
+using MediaBrowser.Controller.Plugins;
+using MediaBrowser.Controller.Session;
+using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Extensions;
+using MediaBrowser.Model.Session;
using MediaBrowser.Model.Threading;
+using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.EntryPoints
{
@@ -62,9 +62,7 @@ namespace Emby.Server.Implementations.EntryPoints
UpdateTimer.Change(UpdateDuration, Timeout.Infinite);
}
- List<BaseItem> keys;
-
- if (!_changedItems.TryGetValue(e.UserId, out keys))
+ if (!_changedItems.TryGetValue(e.UserId, out List<BaseItem> keys))
{
keys = new List<BaseItem>();
_changedItems[e.UserId] = keys;