diff options
| author | Cody Robibero <cody@robibe.ro> | 2024-09-26 07:44:43 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-26 07:44:43 -0600 |
| commit | bc9594aeedcd1ddf2b6bf07a1abbef129b6ea389 (patch) | |
| tree | 11bd2fbd8f5b32ea5328ea41ced4b8503e36a652 | |
| parent | 75bbd3029613829a9b55ac01e27093583fc8cf52 (diff) | |
| parent | 8499be23ccfbe1b7eed6768d3ea634a6eed05217 (diff) | |
Merge pull request #12700 from elfalem/allowed-tags-private-playlist
| -rw-r--r-- | Emby.Server.Implementations/Data/SqliteItemRepository.cs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs index 60f5ee47a..3da925f93 100644 --- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs +++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs @@ -4203,6 +4203,15 @@ namespace Emby.Server.Implementations.Data OR (select CleanValue from ItemValues where ItemId=ParentId and Type=6 and CleanValue in ({includedTags})) is not null) """); } + + // A playlist should be accessible to its owner regardless of allowed tags. + else if (includeTypes.Length == 1 && includeTypes.FirstOrDefault() is BaseItemKind.Playlist) + { + whereClauses.Add($""" + ((select CleanValue from ItemValues where ItemId=Guid and Type=6 and CleanValue in ({includedTags})) is not null + OR data like @PlaylistOwnerUserId) + """); + } else { whereClauses.Add("((select CleanValue from ItemValues where ItemId=Guid and Type=6 and cleanvalue in (" + includedTags + ")) is not null)"); @@ -4214,6 +4223,11 @@ namespace Emby.Server.Implementations.Data { statement.TryBind(paramName + index, GetCleanValue(query.IncludeInheritedTags[index])); } + + if (query.User is not null) + { + statement.TryBind("@PlaylistOwnerUserId", $"""%"OwnerUserId":"{query.User.Id.ToString("N")}"%"""); + } } } |
