aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/EntryPoints
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Server.Implementations/EntryPoints')
-rw-r--r--MediaBrowser.Server.Implementations/EntryPoints/ActivityLogEntryPoint.cs18
-rw-r--r--MediaBrowser.Server.Implementations/EntryPoints/ExternalPortForwarding.cs30
-rw-r--r--MediaBrowser.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs4
-rw-r--r--MediaBrowser.Server.Implementations/EntryPoints/LoadRegistrations.cs1
-rw-r--r--MediaBrowser.Server.Implementations/EntryPoints/Notifications/Notifications.cs2
-rw-r--r--MediaBrowser.Server.Implementations/EntryPoints/UsageReporter.cs3
6 files changed, 11 insertions, 47 deletions
diff --git a/MediaBrowser.Server.Implementations/EntryPoints/ActivityLogEntryPoint.cs b/MediaBrowser.Server.Implementations/EntryPoints/ActivityLogEntryPoint.cs
index dfaedbc9d..46ddf3dd8 100644
--- a/MediaBrowser.Server.Implementations/EntryPoints/ActivityLogEntryPoint.cs
+++ b/MediaBrowser.Server.Implementations/EntryPoints/ActivityLogEntryPoint.cs
@@ -5,11 +5,9 @@ using MediaBrowser.Common.ScheduledTasks;
using MediaBrowser.Common.Updates;
using MediaBrowser.Controller;
using MediaBrowser.Controller.Activity;
-using MediaBrowser.Controller.Channels;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
-using MediaBrowser.Controller.LiveTv;
using MediaBrowser.Controller.Localization;
using MediaBrowser.Controller.Plugins;
using MediaBrowser.Controller.Session;
@@ -206,7 +204,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
Name = name,
Type = "SessionEnded",
ShortOverview = string.Format(_localization.GetLocalizedString("LabelIpAddressValue"), session.RemoteEndPoint),
- UserId = (session.UserId.HasValue ? session.UserId.Value.ToString("N") : null)
+ UserId = session.UserId.HasValue ? session.UserId.Value.ToString("N") : null
});
}
@@ -336,7 +334,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
Name = name,
Type = "SessionStarted",
ShortOverview = string.Format(_localization.GetLocalizedString("LabelIpAddressValue"), session.RemoteEndPoint),
- UserId = (session.UserId.HasValue ? session.UserId.Value.ToString("N") : null)
+ UserId = session.UserId.HasValue ? session.UserId.Value.ToString("N") : null
});
}
@@ -518,16 +516,16 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
int days = span.Days;
if (days >= DaysInYear)
{
- int years = (days / DaysInYear);
+ int years = days / DaysInYear;
values.Add(CreateValueString(years, "year"));
- days = (days % DaysInYear);
+ days = days % DaysInYear;
}
// Number of months
if (days >= DaysInMonth)
{
- int months = (days / DaysInMonth);
+ int months = days / DaysInMonth;
values.Add(CreateValueString(months, "month"));
- days = (days % DaysInMonth);
+ days = days % DaysInMonth;
}
// Number of days
if (days >= 1)
@@ -547,7 +545,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
for (int i = 0; i < values.Count; i++)
{
if (builder.Length > 0)
- builder.Append((i == (values.Count - 1)) ? " and " : ", ");
+ builder.Append(i == values.Count - 1 ? " and " : ", ");
builder.Append(values[i]);
}
// Return result
@@ -562,7 +560,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
private static string CreateValueString(int value, string description)
{
return String.Format("{0:#,##0} {1}",
- value, (value == 1) ? description : String.Format("{0}s", description));
+ value, value == 1 ? description : String.Format("{0}s", description));
}
}
}
diff --git a/MediaBrowser.Server.Implementations/EntryPoints/ExternalPortForwarding.cs b/MediaBrowser.Server.Implementations/EntryPoints/ExternalPortForwarding.cs
index 2b2c338dd..5777a0af7 100644
--- a/MediaBrowser.Server.Implementations/EntryPoints/ExternalPortForwarding.cs
+++ b/MediaBrowser.Server.Implementations/EntryPoints/ExternalPortForwarding.cs
@@ -10,7 +10,6 @@ using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
-using System.Threading;
using MediaBrowser.Common.Threading;
namespace MediaBrowser.Server.Implementations.EntryPoints
@@ -51,8 +50,6 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
void _config_ConfigurationUpdated(object sender, EventArgs e)
{
- _config.ConfigurationUpdated -= _config_ConfigurationUpdated;
-
if (!string.Equals(_lastConfigIdentifier, GetConfigIdentifier(), StringComparison.OrdinalIgnoreCase))
{
if (_isStarted)
@@ -227,30 +224,5 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
_isStarted = false;
}
}
-
- private class LogWriter : TextWriter
- {
- private readonly ILogger _logger;
-
- public LogWriter(ILogger logger)
- {
- _logger = logger;
- }
-
- public override Encoding Encoding
- {
- get { return Encoding.UTF8; }
- }
-
- public override void WriteLine(string format, params object[] arg)
- {
- _logger.Debug(format, arg);
- }
-
- public override void WriteLine(string value)
- {
- _logger.Debug(value);
- }
- }
}
-}
+} \ No newline at end of file
diff --git a/MediaBrowser.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs b/MediaBrowser.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs
index 237c7157b..afc4e9702 100644
--- a/MediaBrowser.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs
+++ b/MediaBrowser.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs
@@ -1,5 +1,4 @@
-using MediaBrowser.Controller.Channels;
-using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Plugins;
using MediaBrowser.Controller.Session;
@@ -11,7 +10,6 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading;
using MediaBrowser.Controller.Entities.Audio;
-using MediaBrowser.Controller.LiveTv;
namespace MediaBrowser.Server.Implementations.EntryPoints
{
diff --git a/MediaBrowser.Server.Implementations/EntryPoints/LoadRegistrations.cs b/MediaBrowser.Server.Implementations/EntryPoints/LoadRegistrations.cs
index efda36821..f41d81137 100644
--- a/MediaBrowser.Server.Implementations/EntryPoints/LoadRegistrations.cs
+++ b/MediaBrowser.Server.Implementations/EntryPoints/LoadRegistrations.cs
@@ -2,7 +2,6 @@
using MediaBrowser.Controller.Plugins;
using MediaBrowser.Model.Logging;
using System;
-using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Common.Threading;
diff --git a/MediaBrowser.Server.Implementations/EntryPoints/Notifications/Notifications.cs b/MediaBrowser.Server.Implementations/EntryPoints/Notifications/Notifications.cs
index ca430eda9..9e68ce4ef 100644
--- a/MediaBrowser.Server.Implementations/EntryPoints/Notifications/Notifications.cs
+++ b/MediaBrowser.Server.Implementations/EntryPoints/Notifications/Notifications.cs
@@ -22,8 +22,6 @@ using System.Globalization;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
-using MediaBrowser.Controller.Channels;
-using MediaBrowser.Controller.LiveTv;
namespace MediaBrowser.Server.Implementations.EntryPoints.Notifications
{
diff --git a/MediaBrowser.Server.Implementations/EntryPoints/UsageReporter.cs b/MediaBrowser.Server.Implementations/EntryPoints/UsageReporter.cs
index cbec91679..7b3a7a30d 100644
--- a/MediaBrowser.Server.Implementations/EntryPoints/UsageReporter.cs
+++ b/MediaBrowser.Server.Implementations/EntryPoints/UsageReporter.cs
@@ -8,7 +8,6 @@ using System.Globalization;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
-using MediaBrowser.Controller.Configuration;
using MediaBrowser.Model.Logging;
namespace MediaBrowser.Server.Implementations.EntryPoints
@@ -19,7 +18,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
private readonly IHttpClient _httpClient;
private readonly IUserManager _userManager;
private readonly ILogger _logger;
- private const string MbAdminUrl = "http://www.mb3admin.com/admin/";
+ private const string MbAdminUrl = "https://www.mb3admin.com/admin/";
public UsageReporter(IApplicationHost applicationHost, IHttpClient httpClient, IUserManager userManager, ILogger logger)
{