mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-26 18:54:48 +03:00
added an allow mode filter for tags
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user