Fixing Archive download sorting by moving nulls to the end.

This commit is contained in:
Roland 2025-02-04 17:11:11 -07:00
parent fab3fd62ed
commit 13407af64c
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680

View file

@ -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',