aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Sorting/DateLastMediaAddedComparer.cs
diff options
context:
space:
mode:
authorcrobibero <cody@robibe.ro>2020-09-11 15:53:04 -0600
committercrobibero <cody@robibe.ro>2020-09-11 15:53:04 -0600
commitf13b87afa3e81e7fa2710caec58a7d6cb20f7635 (patch)
tree0f269ac5baa27b334c5377d9dec4010aedf25183 /Emby.Server.Implementations/Sorting/DateLastMediaAddedComparer.cs
parent2363ad544979adf32207fa927f106fadb784f1fb (diff)
parent6bf0acb854683377bebad3ca27de17706519c420 (diff)
Merge remote-tracking branch 'upstream/master' into api-upload-subtitle
Diffstat (limited to 'Emby.Server.Implementations/Sorting/DateLastMediaAddedComparer.cs')
-rw-r--r--Emby.Server.Implementations/Sorting/DateLastMediaAddedComparer.cs19
1 files changed, 10 insertions, 9 deletions
diff --git a/Emby.Server.Implementations/Sorting/DateLastMediaAddedComparer.cs b/Emby.Server.Implementations/Sorting/DateLastMediaAddedComparer.cs
index 623675157..03ff19d21 100644
--- a/Emby.Server.Implementations/Sorting/DateLastMediaAddedComparer.cs
+++ b/Emby.Server.Implementations/Sorting/DateLastMediaAddedComparer.cs
@@ -1,4 +1,7 @@
+#pragma warning disable CS1591
+
using System;
+using Jellyfin.Data.Entities;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Sorting;
@@ -27,6 +30,12 @@ namespace Emby.Server.Implementations.Sorting
public IUserDataManager UserDataRepository { get; set; }
/// <summary>
+ /// Gets the name.
+ /// </summary>
+ /// <value>The name.</value>
+ public string Name => ItemSortBy.DateLastContentAdded;
+
+ /// <summary>
/// Compares the specified x.
/// </summary>
/// <param name="x">The x.</param>
@@ -44,9 +53,7 @@ namespace Emby.Server.Implementations.Sorting
/// <returns>DateTime.</returns>
private static DateTime GetDate(BaseItem x)
{
- var folder = x as Folder;
-
- if (folder != null)
+ if (x is Folder folder)
{
if (folder.DateLastMediaAdded.HasValue)
{
@@ -56,11 +63,5 @@ namespace Emby.Server.Implementations.Sorting
return DateTime.MinValue;
}
-
- /// <summary>
- /// Gets the name.
- /// </summary>
- /// <value>The name.</value>
- public string Name => ItemSortBy.DateLastContentAdded;
}
}