Merge pull request #1858 from MediaBrowser/dev

Dev
This commit is contained in:
Luke 2016-06-17 20:53:29 -04:00 committed by GitHub
commit 89d6d82183
2 changed files with 6 additions and 10 deletions

View File

@ -3618,7 +3618,6 @@ namespace MediaBrowser.Server.Implementations.Persistence
var whereText = " where Type=@SelectType"; var whereText = " where Type=@SelectType";
whereText += " And CleanName In (Select CleanValue from ItemValues where Type=@ItemValueType AND ItemId in (select guid from TypedBaseItems" + innerWhereText + "))"; whereText += " And CleanName In (Select CleanValue from ItemValues where Type=@ItemValueType AND ItemId in (select guid from TypedBaseItems" + innerWhereText + "))";
cmd.CommandText += whereText;
var outerQuery = new InternalItemsQuery(query.User) var outerQuery = new InternalItemsQuery(query.User)
{ {
@ -3638,10 +3637,13 @@ namespace MediaBrowser.Server.Implementations.Persistence
var outerWhereClauses = GetWhereClauses(outerQuery, cmd); var outerWhereClauses = GetWhereClauses(outerQuery, cmd);
var outerWhereText = outerWhereClauses.Count == 0 ? whereText += outerWhereClauses.Count == 0 ?
string.Empty : string.Empty :
" AND " + string.Join(" AND ", outerWhereClauses.ToArray()); " AND " + string.Join(" AND ", outerWhereClauses.ToArray());
cmd.CommandText += outerWhereText; //cmd.CommandText += GetGroupBy(query);
cmd.CommandText += whereText;
cmd.CommandText += " group by PresentationUniqueKey";
cmd.Parameters.Add(cmd, "@SelectType", DbType.String).Value = returnType; cmd.Parameters.Add(cmd, "@SelectType", DbType.String).Value = returnType;
cmd.Parameters.Add(cmd, "@ItemValueType", DbType.Int32).Value = itemValueType; cmd.Parameters.Add(cmd, "@ItemValueType", DbType.Int32).Value = itemValueType;
@ -3651,9 +3653,6 @@ namespace MediaBrowser.Server.Implementations.Persistence
cmd.Parameters.Add(cmd, "@UserId", DbType.Guid).Value = query.User.Id; cmd.Parameters.Add(cmd, "@UserId", DbType.Guid).Value = query.User.Id;
} }
//cmd.CommandText += GetGroupBy(query);
cmd.CommandText += " group by PresentationUniqueKey";
cmd.CommandText += " order by SortName"; cmd.CommandText += " order by SortName";
if (query.Limit.HasValue || query.StartIndex.HasValue) if (query.Limit.HasValue || query.StartIndex.HasValue)
@ -3679,7 +3678,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
if (query.EnableTotalRecordCount) if (query.EnableTotalRecordCount)
{ {
cmd.CommandText += "select count (guid)" + GetFromText(); cmd.CommandText += "select count (distinct PresentationUniqueKey)" + GetFromText();
cmd.CommandText += GetJoinUserDataText(query); cmd.CommandText += GetJoinUserDataText(query);
cmd.CommandText += whereText; cmd.CommandText += whereText;

View File

@ -965,9 +965,6 @@
<Content Include="dashboard-ui\scripts\metadatasubtitles.js"> <Content Include="dashboard-ui\scripts\metadatasubtitles.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="dashboard-ui\scripts\musicalbumartists.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\scripts\livetvchannels.js"> <Content Include="dashboard-ui\scripts\livetvchannels.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>