aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Dto
diff options
context:
space:
mode:
authorLogicalPhallacy <44458166+LogicalPhallacy@users.noreply.github.com>2022-09-23 23:09:38 -0400
committerJoshua M. Boniface <joshua@boniface.me>2022-09-23 23:09:38 -0400
commite8893f3d416c7eab96fef2fb8330fc20d29efafc (patch)
treee7690d07dc881631fcb585131d77868107be89cb /Emby.Server.Implementations/Dto
parent4a261a3ec05bcd114885a66def4a6212411491d8 (diff)
Backport pull request #8399 from jellyfin/release-10.8.z
Respect visibility for people items (rebased) Original-merge: e6124bc154c9f95fdd491f309623def6b3df0171 Merged-by: Bond-009 <bond.009@outlook.com> Backported-by: Joshua M. Boniface <joshua@boniface.me>
Diffstat (limited to 'Emby.Server.Implementations/Dto')
-rw-r--r--Emby.Server.Implementations/Dto/DtoService.cs8
1 files changed, 6 insertions, 2 deletions
diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.cs
index 09ba36851..3d2b8f7f6 100644
--- a/Emby.Server.Implementations/Dto/DtoService.cs
+++ b/Emby.Server.Implementations/Dto/DtoService.cs
@@ -182,7 +182,7 @@ namespace Emby.Server.Implementations.Dto
if (options.ContainsField(ItemFields.People))
{
- AttachPeople(dto, item);
+ AttachPeople(dto, item, user);
}
if (options.ContainsField(ItemFields.PrimaryImageAspectRatio))
@@ -503,7 +503,8 @@ namespace Emby.Server.Implementations.Dto
/// </summary>
/// <param name="dto">The dto.</param>
/// <param name="item">The item.</param>
- private void AttachPeople(BaseItemDto dto, BaseItem item)
+ /// <param name="user">The requesting user.</param>
+ private void AttachPeople(BaseItemDto dto, BaseItem item, User user = null)
{
// Ordering by person type to ensure actors and artists are at the front.
// This is taking advantage of the fact that they both begin with A
@@ -560,6 +561,9 @@ namespace Emby.Server.Implementations.Dto
return null;
}
}).Where(i => i != null)
+ .Where(i => user == null ?
+ true :
+ i.IsVisible(user))
.GroupBy(i => i.Name, StringComparer.OrdinalIgnoreCase)
.Select(x => x.First())
.ToDictionary(i => i.Name, StringComparer.OrdinalIgnoreCase);