Permalink
Browse files

SortUtils: fix limiting being applied twice for items sorted/limited …

…in the database

When items are limited by the database (through SQL LIMIT) because there is no
sorting to be done (SortByNone), we can't apply the limiting once again in
SortUtils::Sort.
  • Loading branch information...
1 parent aa3494c commit c1baa7f33af0b37e541ae2e501409e49347af334 @Montellese Montellese committed Jun 23, 2012
Showing with 8 additions and 1 deletion.
  1. +8 −1 xbmc/utils/SortUtils.cpp
View
@@ -686,7 +686,14 @@ bool SortUtils::SortFromDataset(const SortDescription &sortDescription, MediaTyp
if (!DatabaseUtils::GetDatabaseResults(mediaType, fields, dataset, results))
return false;
- Sort(sortDescription, results);
+ SortDescription sorting = sortDescription;
+ if (sortDescription.sortBy == SortByNone)
+ {
+ sorting.limitStart = 0;
+ sorting.limitEnd = -1;
+ }
+
+ Sort(sorting, results);
return true;
}

0 comments on commit c1baa7f

Please sign in to comment.