#182 - Eliminate duplicates in the selection list for max rating in user screen
This commit is contained in:
parent
a55999b780
commit
47d2a11bdf
|
@ -849,10 +849,15 @@ namespace MediaBrowser.Controller.Entities
|
||||||
{
|
{
|
||||||
if (user == null)
|
if (user == null)
|
||||||
{
|
{
|
||||||
throw new ArgumentNullException();
|
throw new ArgumentNullException("user");
|
||||||
}
|
}
|
||||||
|
|
||||||
return user.Configuration.MaxParentalRating == null || Ratings.Level(CustomRating ?? OfficialRating) <= user.Configuration.MaxParentalRating;
|
if (string.IsNullOrEmpty(user.Configuration.MaxParentalRating))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Ratings.Level(CustomRating ?? OfficialRating) <= Ratings.Level(user.Configuration.MaxParentalRating);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using MediaBrowser.Controller.Configuration;
|
using System.Globalization;
|
||||||
|
using MediaBrowser.Controller.Configuration;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
|
@ -10,7 +10,7 @@ namespace MediaBrowser.Model.Configuration
|
||||||
/// Gets or sets the max parental rating.
|
/// Gets or sets the max parental rating.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The max parental rating.</value>
|
/// <value>The max parental rating.</value>
|
||||||
public int? MaxParentalRating { get; set; }
|
public string MaxParentalRating { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets a value indicating whether [use custom library].
|
/// Gets or sets a value indicating whether [use custom library].
|
||||||
|
|
Loading…
Reference in New Issue
Block a user