aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-02-09 01:17:11 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-02-09 01:17:11 -0500
commit01828f19a766b8bdddb022665cb5302f5cd745fd (patch)
tree63b04f36cd4641b5b9d7ed2ab01f7a253838359f /MediaBrowser.Server.Implementations
parentac68e0ba413e833ede14034cf3367e33b94b9eb3 (diff)
added an allow mode filter for tags
Diffstat (limited to 'MediaBrowser.Server.Implementations')
-rw-r--r--MediaBrowser.Server.Implementations/Library/UserManager.cs20
-rw-r--r--MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json2
-rw-r--r--MediaBrowser.Server.Implementations/Localization/Server/server.json8
3 files changed, 27 insertions, 3 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/UserManager.cs b/MediaBrowser.Server.Implementations/Library/UserManager.cs
index 37f7e31fa..47903525b 100644
--- a/MediaBrowser.Server.Implementations/Library/UserManager.cs
+++ b/MediaBrowser.Server.Implementations/Library/UserManager.cs
@@ -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)
diff --git a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json
index 184a7f9a4..cb99b57bb 100644
--- a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json
+++ b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json
@@ -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",
diff --git a/MediaBrowser.Server.Implementations/Localization/Server/server.json b/MediaBrowser.Server.Implementations/Localization/Server/server.json
index a75f4c83b..e78b19c05 100644
--- a/MediaBrowser.Server.Implementations/Localization/Server/server.json
+++ b/MediaBrowser.Server.Implementations/Localization/Server/server.json
@@ -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."
}