mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Ensure user's own playlists are accessible regardless of allowed tags
This commit is contained in:
parent
cb8f01065a
commit
dafd186410
@ -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)
|
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
|
else
|
||||||
{
|
{
|
||||||
whereClauses.Add("((select CleanValue from ItemValues where ItemId=Guid and Type=6 and cleanvalue in (" + includedTags + ")) is not null)");
|
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]));
|
statement.TryBind(paramName + index, GetCleanValue(query.IncludeInheritedTags[index]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (query.User != null)
|
||||||
|
{
|
||||||
|
statement.TryBind("@PlaylistOwnerUserId", $"""%"OwnerUserId":"{query.User.Id.ToString("N")}"%""");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user