update dlna genre views

This commit is contained in:
Luke Pulverenti
2016-12-20 14:59:25 -05:00
parent 74ec6e5a06
commit ac2c45dd6a
12 changed files with 125 additions and 104 deletions

View File

@@ -3855,16 +3855,18 @@ namespace Emby.Server.Implementations.Data
}
}
if (query.ArtistNames.Length > 0)
if (query.ArtistIds.Length > 0)
{
var clauses = new List<string>();
var index = 0;
foreach (var artist in query.ArtistNames)
foreach (var artistId in query.ArtistIds)
{
clauses.Add("@ArtistName" + index + " in (select CleanValue from itemvalues where ItemId=Guid and Type <= 1)");
var paramName = "@ArtistIds" + index;
clauses.Add("(select CleanName from TypedBaseItems where guid=" + paramName + ") in (select CleanValue from itemvalues where ItemId=Guid and Type<=1)");
if (statement != null)
{
statement.TryBind("@ArtistName" + index, GetCleanValue(artist));
statement.TryBind(paramName, artistId.ToGuidParamValue());
}
index++;
}
@@ -3963,23 +3965,6 @@ namespace Emby.Server.Implementations.Data
whereClauses.Add(clause);
}
if (query.Studios.Length > 0)
{
var clauses = new List<string>();
var index = 0;
foreach (var item in query.Studios)
{
clauses.Add("@Studio" + index + " in (select CleanValue from itemvalues where ItemId=Guid and Type=3)");
if (statement != null)
{
statement.TryBind("@Studio" + index, GetCleanValue(item));
}
index++;
}
var clause = "(" + string.Join(" OR ", clauses.ToArray()) + ")";
whereClauses.Add(clause);
}
if (query.Keywords.Length > 0)
{
var clauses = new List<string>();