added an allow mode filter for tags

This commit is contained in:
Luke Pulverenti
2015-02-09 01:17:11 -05:00
parent ac68e0ba41
commit 01828f19a7
15 changed files with 119 additions and 10 deletions

View File

@@ -168,6 +168,7 @@ namespace MediaBrowser.Server.Implementations.Library
foreach (var user in users)
{
await DoPolicyMigration(user).ConfigureAwait(false);
await DoBlockedTagMigration(user).ConfigureAwait(false);
}
// If there are no local users with admin rights, make them all admins
@@ -346,6 +347,25 @@ namespace MediaBrowser.Server.Implementations.Library
}
}
private async Task DoBlockedTagMigration(User user)
{
if (user.Policy.BlockedTags != null)
{
user.Policy.TagFilters = user.Policy
.BlockedTags
.Select(i => new TagFilter
{
Tag = i,
Mode = TagFilterMode.Block
})
.ToArray();
user.Policy.BlockedTags = null;
await UpdateUserPolicy(user, user.Policy, false);
}
}
public UserDto GetUserDto(User user, string remoteEndPoint = null)
{
if (user == null)

View File

@@ -276,7 +276,7 @@
"ButtonStart": "Start",
"HeaderChannels": "Channels",
"HeaderMediaFolders": "Media Folders",
"HeaderBlockItemsWithNoRating": "Block items with no rating information:",
"HeaderBlockItemsWithNoRating": "Block content with no rating information:",
"OptionBlockOthers": "Others",
"OptionBlockTvShows": "TV Shows",
"OptionBlockTrailers": "Trailers",

View File

@@ -1356,8 +1356,10 @@
"HeaderVideoTypes": "Video Types",
"HeaderYears": "Years",
"HeaderAddTag": "Add Tag",
"LabelBlockItemsWithTags": "Block items with tags:",
"LabelBlockOrAllowItemsWithTags": "Block or allow content with tags:",
"LabelTag": "Tag:",
"OptionBlockItemWithTag": "Block all content with this tag",
"OptionAllowItemWithTag": "Allow only content with this tag",
"LabelEnableSingleImageInDidlLimit": "Limit to single embedded image",
"LabelEnableSingleImageInDidlLimitHelp": "Some devices will not render properly if multiple images are embedded within Didl.",
"TabActivity": "Activity",
@@ -1368,5 +1370,7 @@
"NameSeasonNumber": "Season {0}",
"LabelNewUserNameHelp": "Usernames can contain letters (a-z), numbers (0-9), dashes (-), underscores (_), apostrophes ('), and periods (.)",
"TabJobs": "Jobs",
"TabSyncJobs": "Sync Jobs"
"TabSyncJobs": "Sync Jobs",
"LabelTagFilterMode": "Mode:",
"LabelTagFilterAllowModeHelp": "If used as part of a deeply nested folder structure, content that is tagged with this mechanism will require parent folders to be tagged as well."
}