diff options
| author | David <daullmer@gmail.com> | 2020-06-14 12:45:49 +0200 |
|---|---|---|
| committer | David <daullmer@gmail.com> | 2020-06-14 12:45:49 +0200 |
| commit | d01f56bc423c81b4f86ed1591c61b6b4ef579c24 (patch) | |
| tree | 424aa3c1601e2c1a82dc685c356bfd0d50437f04 /Emby.Server.Implementations/Sorting/StartDateComparer.cs | |
| parent | a47ff4043f2116716d5f15d1f79657550052bde8 (diff) | |
| parent | 0011e8df47380936742302ef40639a4626a780ed (diff) | |
Merge remote-tracking branch 'upstream/api-migration' into api-subtitles
Diffstat (limited to 'Emby.Server.Implementations/Sorting/StartDateComparer.cs')
| -rw-r--r-- | Emby.Server.Implementations/Sorting/StartDateComparer.cs | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/Emby.Server.Implementations/Sorting/StartDateComparer.cs b/Emby.Server.Implementations/Sorting/StartDateComparer.cs index aa040fa15..558a3d351 100644 --- a/Emby.Server.Implementations/Sorting/StartDateComparer.cs +++ b/Emby.Server.Implementations/Sorting/StartDateComparer.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS1591 + using System; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.LiveTv; @@ -9,6 +11,12 @@ namespace Emby.Server.Implementations.Sorting public class StartDateComparer : IBaseItemComparer { /// <summary> + /// Gets the name. + /// </summary> + /// <value>The name.</value> + public string Name => ItemSortBy.StartDate; + + /// <summary> /// Compares the specified x. /// </summary> /// <param name="x">The x.</param> @@ -26,19 +34,12 @@ namespace Emby.Server.Implementations.Sorting /// <returns>DateTime.</returns> private static DateTime GetDate(BaseItem x) { - var hasStartDate = x as LiveTvProgram; - - if (hasStartDate != null) + if (x is LiveTvProgram hasStartDate) { return hasStartDate.StartDate; } + return DateTime.MinValue; } - - /// <summary> - /// Gets the name. - /// </summary> - /// <value>The name.</value> - public string Name => ItemSortBy.StartDate; } } |
