Skip to content

Commit b7231dd

Browse files
committed
fix sorting by created timestamp
1 parent edc5e82 commit b7231dd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

api/src/controllers/torrent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ export const getTorrentsPage = async ({
463463
const combinedSort = {};
464464
if (sortField) combinedSort[sortField] = sortDir;
465465
if (query) combinedSort.confidenceScore = { $meta: "textScore" };
466-
combinedSort.created = -1;
466+
if (!combinedSort.created) combinedSort.created = -1;
467467

468468
const torrents = await Torrent.aggregate([
469469
...(query

0 commit comments

Comments
 (0)