Selaa lähdekoodia

#182 - Eliminate duplicates in the selection list for max rating in user screen

Luke Pulverenti 12 vuotta sitten
vanhempi
sitoutus
6ef9fd9513

+ 2 - 2
MediaBrowser.Controller/Entities/BaseItem.cs

@@ -852,12 +852,12 @@ namespace MediaBrowser.Controller.Entities
                 throw new ArgumentNullException("user");
             }
 
-            if (string.IsNullOrEmpty(user.Configuration.MaxParentalRating))
+            if (user.Configuration.MaxParentalRating == null)
             {
                 return true;
             }
 
-            return Ratings.Level(CustomRating ?? OfficialRating) <= Ratings.Level(user.Configuration.MaxParentalRating);
+            return Ratings.Level(CustomRating ?? OfficialRating) <= user.Configuration.MaxParentalRating.Value;
         }
 
         /// <summary>

+ 1 - 1
MediaBrowser.Model/Configuration/UserConfiguration.cs

@@ -10,7 +10,7 @@ namespace MediaBrowser.Model.Configuration
         /// Gets or sets the max parental rating.
         /// </summary>
         /// <value>The max parental rating.</value>
-        public string MaxParentalRating { get; set; }
+        public int? MaxParentalRating { get; set; }
 
         /// <summary>
         /// Gets or sets a value indicating whether [use custom library].