From 13407af64c0d507f6b374829d781ec053f084dbf Mon Sep 17 00:00:00 2001 From: Roland Date: Tue, 4 Feb 2025 17:11:11 -0700 Subject: [PATCH] Fixing Archive download sorting by moving nulls to the end. --- modules/archive/lib.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/archive/lib.py b/modules/archive/lib.py index 279981fa..2d88d01a 100644 --- a/modules/archive/lib.py +++ b/modules/archive/lib.py @@ -442,12 +442,12 @@ def get_domains(): ARCHIVE_ORDERS = { - 'published_datetime': (date := 'COALESCE(fg.published_datetime, fg.download_datetime) ASC'), + 'published_datetime': (date := 'COALESCE(fg.published_datetime, fg.download_datetime) ASC NULLS LAST'), '-published_datetime': (_date := 'COALESCE(fg.published_datetime, fg.download_datetime) DESC NULLS LAST'), 'published_modified_datetime': f'fg.published_modified_datetime ASC NULLS LAST, {date}', - '-published_modified_datetime': f'fg.published_modified_datetime DESC, {_date}', - 'download_datetime': 'fg.download_datetime ASC', - '-download_datetime': 'fg.download_datetime DESC', + '-published_modified_datetime': f'fg.published_modified_datetime DESC NULLS LAST, {_date}', + 'download_datetime': 'fg.download_datetime ASC NULLS LAST', + '-download_datetime': 'fg.download_datetime DESC NULLS LAST', 'rank': f'2 DESC, {_date}', '-rank': f'2 ASC, {date}', 'size': 'fg.size ASC, LOWER(fg.primary_path) ASC',