diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-04-09 22:32:27 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-04-09 22:32:27 -0400 |
| commit | 6ea48d1e7c32f159c2e8c92f73f84b09bb78ec3f (patch) | |
| tree | fd907ec9c752b7c760ab764f74a15b35f6ff660d /MediaBrowser.Server.Implementations/EntryPoints/ActivityLogEntryPoint.cs | |
| parent | be4f301198fa0d1d455478eebfc960a6e61c33e9 (diff) | |
| parent | 638dba51ec75f9180c44ec4e75b67f7cea774910 (diff) | |
Merge branch 'beta'
Diffstat (limited to 'MediaBrowser.Server.Implementations/EntryPoints/ActivityLogEntryPoint.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/EntryPoints/ActivityLogEntryPoint.cs | 18 |
1 files changed, 8 insertions, 10 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)); } } } |
