mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-24 19:14:56 +01:00
update playlist query
This commit is contained in:
@@ -1345,16 +1345,7 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
|
||||
}, CancellationToken.None).Result.ToList();
|
||||
|
||||
query.TopParentIds = userViews.SelectMany(GetTopParentsForQuery).Select(i => i.Id.ToString("N")).ToArray();
|
||||
}
|
||||
|
||||
// TODO: handle blocking by tags
|
||||
|
||||
query.MaxParentalRating = user.Policy.MaxParentalRating;
|
||||
|
||||
if (user.Policy.MaxParentalRating.HasValue)
|
||||
{
|
||||
query.BlockUnratedItems = user.Policy.BlockUnratedItems;
|
||||
//query.TopParentIds = userViews.SelectMany(GetTopParentsForQuery).Select(i => i.Id.ToString("N")).ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1985,6 +1985,14 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||
var inClause = string.Join(",", query.BlockUnratedItems.Select(i => "'" + i.ToString() + "'").ToArray());
|
||||
whereClauses.Add(string.Format("(InheritedParentalRatingValue > 0 or UnratedType not in ({0}))", inClause));
|
||||
}
|
||||
|
||||
//var excludeTagIndex = 0;
|
||||
//foreach (var excludeTag in query.ExcludeTags)
|
||||
//{
|
||||
// whereClauses.Add("Tags not like @excludeTag" + excludeTagIndex);
|
||||
// cmd.Parameters.Add(cmd, "@excludeTag" + excludeTagIndex, DbType.String).Value = "%" + excludeTag + "%";
|
||||
// excludeTagIndex++;
|
||||
//}
|
||||
|
||||
if (addPaging)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user