albums: fix sort order
Signed-off-by: Varun Patil <radialapps@gmail.com>pull/767/head
parent
4ce6c5dbe1
commit
5b1cab9f91
|
@ -64,8 +64,6 @@ class AlbumsQuery
|
||||||
|
|
||||||
// GROUP and ORDER by
|
// GROUP and ORDER by
|
||||||
$query->groupBy('pa.album_id');
|
$query->groupBy('pa.album_id');
|
||||||
$query->orderBy('pa.created', 'DESC');
|
|
||||||
$query->addOrderBy('pa.album_id', 'DESC'); // tie-breaker
|
|
||||||
|
|
||||||
// WHERE these albums contain fileid if specified
|
// WHERE these albums contain fileid if specified
|
||||||
if ($fileid) {
|
if ($fileid) {
|
||||||
|
|
|
@ -36,7 +36,7 @@ export async function getAlbums(sort: 1 | 2 = 1, fileid?: number) {
|
||||||
data.sort((a, b) => a.name.localeCompare(b.name, undefined, { sensitivity: 'base' }));
|
data.sort((a, b) => a.name.localeCompare(b.name, undefined, { sensitivity: 'base' }));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
data.sort((a, b) => b.last_added_photo - a.last_added_photo);
|
data.sort((a, b) => b.created - a.created);
|
||||||
}
|
}
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
|
|
Loading…
Reference in New Issue