浏览代码

revert the last bits of the getcount experiment

cvium 4 年之前
父节点
当前提交
a6726730fc
共有 1 个文件被更改,包括 4 次插入15 次删除
  1. 4 15
      Emby.Server.Implementations/Data/SqliteItemRepository.cs

+ 4 - 15
Emby.Server.Implementations/Data/SqliteItemRepository.cs

@@ -2621,21 +2621,10 @@ namespace Emby.Server.Implementations.Data
                 query.Limit = query.Limit.Value + 4;
             }
 
-            var commandText = "select ";
-            if (EnableGroupByPresentationUniqueKey(query))
-            {
-                commandText += "count (distinct PresentationUniqueKey)";
-            }
-            else if (query.GroupBySeriesPresentationUniqueKey)
-            {
-                commandText += "count (distinct SeriesPresentationUniqueKey)";
-            }
-            else
-            {
-                commandText += "count (guid)";
-            }
-
-            commandText += GetFromText() + GetJoinUserDataText(query);
+            var commandText = "select "
+                              + string.Join(',', GetFinalColumnsToSelect(query, new[] { "count(distinct PresentationUniqueKey)" }))
+                              + GetFromText()
+                              + GetJoinUserDataText(query);
 
             var whereClauses = GetWhereClauses(query, null);
             if (whereClauses.Count != 0)