Add block unrated option

This commit is contained in:
Eric Reed
2013-05-23 11:07:25 -04:00
parent 9abafd83eb
commit 8452e2f125
4 changed files with 28 additions and 1 deletions

View File

@@ -1072,6 +1072,11 @@ namespace MediaBrowser.Controller.Entities
return true;
}
if (user.Configuration.BlockNotRated && string.IsNullOrEmpty(CustomRating ?? OfficialRating))
{
return false;
}
return Ratings.Level(CustomRating ?? OfficialRating) <= user.Configuration.MaxParentalRating.Value;
}

View File

@@ -120,6 +120,21 @@ namespace MediaBrowser.Controller.Entities
await LibraryManager.SaveChildren(Id, newChildren, cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// Never want folders to be blocked by "BlockNotRated"
/// </summary>
public override string OfficialRating
{
get
{
return !string.IsNullOrEmpty(base.OfficialRating) ? base.OfficialRating : "None";
}
set
{
base.OfficialRating = value;
}
}
/// <summary>
/// Removes the child.
/// </summary>