|
@@ -2401,13 +2401,17 @@ namespace Emby.Server.Implementations.Data
|
|
var builder = new StringBuilder();
|
|
var builder = new StringBuilder();
|
|
builder.Append('(');
|
|
builder.Append('(');
|
|
|
|
|
|
- if (string.IsNullOrEmpty(item.OfficialRating))
|
|
|
|
|
|
+ if (item.InheritedParentalRatingValue == 0)
|
|
{
|
|
{
|
|
- builder.Append("(OfficialRating is null * 10)");
|
|
|
|
|
|
+ builder.Append("((InheritedParentalRatingValue=0) * 10)");
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- builder.Append("(OfficialRating=@ItemOfficialRating * 10)");
|
|
|
|
|
|
+ builder.Append(
|
|
|
|
+ @"(SELECT CASE WHEN InheritedParentalRatingValue=0
|
|
|
|
+ THEN 0
|
|
|
|
+ ELSE 10.0 / (1.0 + ABS(InheritedParentalRatingValue - @InheritedParentalRatingValue))
|
|
|
|
+ END)");
|
|
}
|
|
}
|
|
|
|
|
|
if (item.ProductionYear.HasValue)
|
|
if (item.ProductionYear.HasValue)
|
|
@@ -2521,6 +2525,11 @@ namespace Emby.Server.Implementations.Data
|
|
{
|
|
{
|
|
statement.TryBind("@SimilarItemId", item.Id);
|
|
statement.TryBind("@SimilarItemId", item.Id);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if (commandText.Contains("@InheritedParentalRatingValue", StringComparison.OrdinalIgnoreCase))
|
|
|
|
+ {
|
|
|
|
+ statement.TryBind("@InheritedParentalRatingValue", item.InheritedParentalRatingValue);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
private string GetJoinUserDataText(InternalItemsQuery query)
|
|
private string GetJoinUserDataText(InternalItemsQuery query)
|