Add block unrated option
This commit is contained in:
parent
9abafd83eb
commit
8452e2f125
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -12,6 +12,12 @@ namespace MediaBrowser.Model.Configuration
|
|||
/// <value>The max parental rating.</value>
|
||||
public int? MaxParentalRating { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether items with no rating information should be blocked.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if items with no rating info should be blocked; otherwise, <c>false</c>.</value>
|
||||
public bool BlockNotRated { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether [use custom library].
|
||||
/// </summary>
|
||||
|
@ -48,6 +54,7 @@ namespace MediaBrowser.Model.Configuration
|
|||
public UserConfiguration()
|
||||
{
|
||||
IsAdministrator = true;
|
||||
BlockNotRated = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<targets async="true"></targets>
|
||||
</nlog>
|
||||
<appSettings>
|
||||
<add key="DebugProgramDataPath" value="..\..\..\..\ProgramData-Server" />
|
||||
<add key="DebugProgramDataPath" value="%ApplicationData%\MediaBrowser-Server" />
|
||||
<add key="ReleaseProgramDataPath" value="%ApplicationData%" />
|
||||
<add key="ProgramDataFolderName" value="MediaBrowser-Server" />
|
||||
<add key="ClientSettingsProvider.ServiceUri" value="" />
|
||||
|
|
Loading…
Reference in New Issue
Block a user