Revert "Replace COUNT(DISTINCT primary_key) with COUNT(*)"

Genres are required as part of the count queries, so filter by genres work
This commit is contained in:
Deluan
2023-11-25 23:08:20 -05:00
parent 8c8e1ea701
commit 28dc98dec4
4 changed files with 5 additions and 1 deletions
+1
View File
@@ -40,6 +40,7 @@ func NewMediaFileRepository(ctx context.Context, o orm.QueryExecutor) *mediaFile
func (r *mediaFileRepository) CountAll(options ...model.QueryOptions) (int64, error) {
sql := r.newSelectWithAnnotation("media_file.id")
sql = r.withGenres(sql) // Required for filtering by genre
return r.count(sql, options...)
}