Преглед на файлове

Fix warnings in Sorting

Patrick Barron преди 3 години
родител
ревизия
078200d8d4

+ 6 - 6
Emby.Server.Implementations/Sorting/AiredEpisodeOrderComparer.cs

@@ -10,6 +10,12 @@ namespace Emby.Server.Implementations.Sorting
 {
     public class AiredEpisodeOrderComparer : IBaseItemComparer
     {
+        /// <summary>
+        /// Gets the name.
+        /// </summary>
+        /// <value>The name.</value>
+        public string Name => ItemSortBy.AiredEpisodeOrder;
+
         /// <summary>
         /// Compares the specified x.
         /// </summary>
@@ -155,11 +161,5 @@ namespace Emby.Server.Implementations.Sorting
 
             return comparisonResult;
         }
-
-        /// <summary>
-        /// Gets the name.
-        /// </summary>
-        /// <value>The name.</value>
-        public string Name => ItemSortBy.AiredEpisodeOrder;
     }
 }

+ 6 - 6
Emby.Server.Implementations/Sorting/AlbumArtistComparer.cs

@@ -12,6 +12,12 @@ namespace Emby.Server.Implementations.Sorting
     /// </summary>
     public class AlbumArtistComparer : IBaseItemComparer
     {
+        /// <summary>
+        /// Gets the name.
+        /// </summary>
+        /// <value>The name.</value>
+        public string Name => ItemSortBy.AlbumArtist;
+
         /// <summary>
         /// Compares the specified x.
         /// </summary>
@@ -34,11 +40,5 @@ namespace Emby.Server.Implementations.Sorting
 
             return audio?.AlbumArtists.FirstOrDefault();
         }
-
-        /// <summary>
-        /// Gets the name.
-        /// </summary>
-        /// <value>The name.</value>
-        public string Name => ItemSortBy.AlbumArtist;
     }
 }

+ 6 - 6
Emby.Server.Implementations/Sorting/AlbumComparer.cs

@@ -11,6 +11,12 @@ namespace Emby.Server.Implementations.Sorting
     /// </summary>
     public class AlbumComparer : IBaseItemComparer
     {
+        /// <summary>
+        /// Gets the name.
+        /// </summary>
+        /// <value>The name.</value>
+        public string Name => ItemSortBy.Album;
+
         /// <summary>
         /// Compares the specified x.
         /// </summary>
@@ -33,11 +39,5 @@ namespace Emby.Server.Implementations.Sorting
 
             return audio == null ? string.Empty : audio.Album;
         }
-
-        /// <summary>
-        /// Gets the name.
-        /// </summary>
-        /// <value>The name.</value>
-        public string Name => ItemSortBy.Album;
     }
 }

+ 6 - 6
Emby.Server.Implementations/Sorting/CriticRatingComparer.cs

@@ -9,6 +9,12 @@ namespace Emby.Server.Implementations.Sorting
     /// </summary>
     public class CriticRatingComparer : IBaseItemComparer
     {
+        /// <summary>
+        /// Gets the name.
+        /// </summary>
+        /// <value>The name.</value>
+        public string Name => ItemSortBy.CriticRating;
+
         /// <summary>
         /// Compares the specified x.
         /// </summary>
@@ -24,11 +30,5 @@ namespace Emby.Server.Implementations.Sorting
         {
             return x?.CriticRating ?? 0;
         }
-
-        /// <summary>
-        /// Gets the name.
-        /// </summary>
-        /// <value>The name.</value>
-        public string Name => ItemSortBy.CriticRating;
     }
 }

+ 6 - 6
Emby.Server.Implementations/Sorting/DateCreatedComparer.cs

@@ -10,6 +10,12 @@ namespace Emby.Server.Implementations.Sorting
     /// </summary>
     public class DateCreatedComparer : IBaseItemComparer
     {
+        /// <summary>
+        /// Gets the name.
+        /// </summary>
+        /// <value>The name.</value>
+        public string Name => ItemSortBy.DateCreated;
+
         /// <summary>
         /// Compares the specified x.
         /// </summary>
@@ -30,11 +36,5 @@ namespace Emby.Server.Implementations.Sorting
 
             return DateTime.Compare(x.DateCreated, y.DateCreated);
         }
-
-        /// <summary>
-        /// Gets the name.
-        /// </summary>
-        /// <value>The name.</value>
-        public string Name => ItemSortBy.DateCreated;
     }
 }

+ 6 - 6
Emby.Server.Implementations/Sorting/DatePlayedComparer.cs

@@ -32,6 +32,12 @@ namespace Emby.Server.Implementations.Sorting
         /// <value>The user data repository.</value>
         public IUserDataManager UserDataRepository { get; set; }
 
+        /// <summary>
+        /// Gets the name.
+        /// </summary>
+        /// <value>The name.</value>
+        public string Name => ItemSortBy.DatePlayed;
+
         /// <summary>
         /// Compares the specified x.
         /// </summary>
@@ -59,11 +65,5 @@ namespace Emby.Server.Implementations.Sorting
 
             return DateTime.MinValue;
         }
-
-        /// <summary>
-        /// Gets the name.
-        /// </summary>
-        /// <value>The name.</value>
-        public string Name => ItemSortBy.DatePlayed;
     }
 }

+ 6 - 6
Emby.Server.Implementations/Sorting/NameComparer.cs

@@ -10,6 +10,12 @@ namespace Emby.Server.Implementations.Sorting
     /// </summary>
     public class NameComparer : IBaseItemComparer
     {
+        /// <summary>
+        /// Gets the name.
+        /// </summary>
+        /// <value>The name.</value>
+        public string Name => ItemSortBy.Name;
+
         /// <summary>
         /// Compares the specified x.
         /// </summary>
@@ -30,11 +36,5 @@ namespace Emby.Server.Implementations.Sorting
 
             return string.Compare(x.Name, y.Name, StringComparison.CurrentCultureIgnoreCase);
         }
-
-        /// <summary>
-        /// Gets the name.
-        /// </summary>
-        /// <value>The name.</value>
-        public string Name => ItemSortBy.Name;
     }
 }

+ 18 - 18
Emby.Server.Implementations/Sorting/PlayCountComparer.cs

@@ -19,6 +19,24 @@ namespace Emby.Server.Implementations.Sorting
         /// <value>The user.</value>
         public User User { get; set; }
 
+        /// <summary>
+        /// Gets the name.
+        /// </summary>
+        /// <value>The name.</value>
+        public string Name => ItemSortBy.PlayCount;
+
+        /// <summary>
+        /// Gets or sets the user data repository.
+        /// </summary>
+        /// <value>The user data repository.</value>
+        public IUserDataManager UserDataRepository { get; set; }
+
+        /// <summary>
+        /// Gets or sets the user manager.
+        /// </summary>
+        /// <value>The user manager.</value>
+        public IUserManager UserManager { get; set; }
+
         /// <summary>
         /// Compares the specified x.
         /// </summary>
@@ -41,23 +59,5 @@ namespace Emby.Server.Implementations.Sorting
 
             return userdata == null ? 0 : userdata.PlayCount;
         }
-
-        /// <summary>
-        /// Gets the name.
-        /// </summary>
-        /// <value>The name.</value>
-        public string Name => ItemSortBy.PlayCount;
-
-        /// <summary>
-        /// Gets or sets the user data repository.
-        /// </summary>
-        /// <value>The user data repository.</value>
-        public IUserDataManager UserDataRepository { get; set; }
-
-        /// <summary>
-        /// Gets or sets the user manager.
-        /// </summary>
-        /// <value>The user manager.</value>
-        public IUserManager UserManager { get; set; }
     }
 }

+ 6 - 6
Emby.Server.Implementations/Sorting/PremiereDateComparer.cs

@@ -10,6 +10,12 @@ namespace Emby.Server.Implementations.Sorting
     /// </summary>
     public class PremiereDateComparer : IBaseItemComparer
     {
+        /// <summary>
+        /// Gets the name.
+        /// </summary>
+        /// <value>The name.</value>
+        public string Name => ItemSortBy.PremiereDate;
+
         /// <summary>
         /// Compares the specified x.
         /// </summary>
@@ -52,11 +58,5 @@ namespace Emby.Server.Implementations.Sorting
 
             return DateTime.MinValue;
         }
-
-        /// <summary>
-        /// Gets the name.
-        /// </summary>
-        /// <value>The name.</value>
-        public string Name => ItemSortBy.PremiereDate;
     }
 }

+ 6 - 6
Emby.Server.Implementations/Sorting/ProductionYearComparer.cs

@@ -9,6 +9,12 @@ namespace Emby.Server.Implementations.Sorting
     /// </summary>
     public class ProductionYearComparer : IBaseItemComparer
     {
+        /// <summary>
+        /// Gets the name.
+        /// </summary>
+        /// <value>The name.</value>
+        public string Name => ItemSortBy.ProductionYear;
+
         /// <summary>
         /// Compares the specified x.
         /// </summary>
@@ -44,11 +50,5 @@ namespace Emby.Server.Implementations.Sorting
 
             return 0;
         }
-
-        /// <summary>
-        /// Gets the name.
-        /// </summary>
-        /// <value>The name.</value>
-        public string Name => ItemSortBy.ProductionYear;
     }
 }

+ 6 - 6
Emby.Server.Implementations/Sorting/RandomComparer.cs

@@ -10,6 +10,12 @@ namespace Emby.Server.Implementations.Sorting
     /// </summary>
     public class RandomComparer : IBaseItemComparer
     {
+        /// <summary>
+        /// Gets the name.
+        /// </summary>
+        /// <value>The name.</value>
+        public string Name => ItemSortBy.Random;
+
         /// <summary>
         /// Compares the specified x.
         /// </summary>
@@ -20,11 +26,5 @@ namespace Emby.Server.Implementations.Sorting
         {
             return Guid.NewGuid().CompareTo(Guid.NewGuid());
         }
-
-        /// <summary>
-        /// Gets the name.
-        /// </summary>
-        /// <value>The name.</value>
-        public string Name => ItemSortBy.Random;
     }
 }

+ 6 - 6
Emby.Server.Implementations/Sorting/RuntimeComparer.cs

@@ -12,6 +12,12 @@ namespace Emby.Server.Implementations.Sorting
     /// </summary>
     public class RuntimeComparer : IBaseItemComparer
     {
+        /// <summary>
+        /// Gets the name.
+        /// </summary>
+        /// <value>The name.</value>
+        public string Name => ItemSortBy.Runtime;
+
         /// <summary>
         /// Compares the specified x.
         /// </summary>
@@ -32,11 +38,5 @@ namespace Emby.Server.Implementations.Sorting
 
             return (x.RunTimeTicks ?? 0).CompareTo(y.RunTimeTicks ?? 0);
         }
-
-        /// <summary>
-        /// Gets the name.
-        /// </summary>
-        /// <value>The name.</value>
-        public string Name => ItemSortBy.Runtime;
     }
 }

+ 6 - 6
Emby.Server.Implementations/Sorting/SortNameComparer.cs

@@ -12,6 +12,12 @@ namespace Emby.Server.Implementations.Sorting
     /// </summary>
     public class SortNameComparer : IBaseItemComparer
     {
+        /// <summary>
+        /// Gets the name.
+        /// </summary>
+        /// <value>The name.</value>
+        public string Name => ItemSortBy.SortName;
+
         /// <summary>
         /// Compares the specified x.
         /// </summary>
@@ -32,11 +38,5 @@ namespace Emby.Server.Implementations.Sorting
 
             return string.Compare(x.SortName, y.SortName, StringComparison.CurrentCultureIgnoreCase);
         }
-
-        /// <summary>
-        /// Gets the name.
-        /// </summary>
-        /// <value>The name.</value>
-        public string Name => ItemSortBy.SortName;
     }
 }

+ 6 - 6
Emby.Server.Implementations/Sorting/StudioComparer.cs

@@ -13,6 +13,12 @@ namespace Emby.Server.Implementations.Sorting
 {
     public class StudioComparer : IBaseItemComparer
     {
+        /// <summary>
+        /// Gets the name.
+        /// </summary>
+        /// <value>The name.</value>
+        public string Name => ItemSortBy.Studio;
+
         /// <summary>
         /// Compares the specified x.
         /// </summary>
@@ -33,11 +39,5 @@ namespace Emby.Server.Implementations.Sorting
 
             return AlphanumericComparator.CompareValues(x.Studios.FirstOrDefault(), y.Studios.FirstOrDefault());
         }
-
-        /// <summary>
-        /// Gets the name.
-        /// </summary>
-        /// <value>The name.</value>
-        public string Name => ItemSortBy.Studio;
     }
 }