remove commented out code and add comment about sort null addition

This commit is contained in:
Robbt 2019-05-09 10:46:39 -04:00
parent 1735cfc5b4
commit 4db93d3cee
1 changed files with 1 additions and 1 deletions

View File

@ -1750,7 +1750,6 @@ SQL;
$qry->add("file_exists", "true", Criteria::EQUAL);
$qry->add("hidden", "false", Criteria::EQUAL);
//$qry->addAsColumn('lptime','COALESCE("lptime",\'1970-01-01\')');
$sortTracks = 'random';
if (isset($storedCrit['sort'])) {
$sortTracks = $storedCrit['sort']['value'];
@ -1761,6 +1760,7 @@ SQL;
else if ($sortTracks == 'oldest') {
$qry->addAscendingOrderByColumn('utime');
}
// these sort additions are needed to override the default postgres NULL sort behavior
else if ($sortTracks == 'mostrecentplay') {
$qry->addDescendingOrderByColumn('(lptime IS NULL), lptime');
}