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)