update playlist query

This commit is contained in:
Luke Pulverenti
2015-11-15 17:30:47 -05:00
parent a45831cdcf
commit 72a0c2afeb
5 changed files with 38 additions and 11 deletions

View File

@@ -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();
}
}

View File

@@ -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)
{