Creating sort button which allows the user to select a sort order via modal.

This commit is contained in:
Roland 2023-04-09 14:13:36 -06:00
parent 3b3cea4d70
commit bab10a0c96
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
14 changed files with 531 additions and 263 deletions

View file

@ -370,6 +370,8 @@ ARCHIVE_ORDERS = {
'-date': 'a.archive_datetime DESC NULLS LAST, LOWER(fg.primary_path) DESC',
'rank': '2 DESC, a.archive_datetime DESC',
'-rank': '2 ASC, a.archive_datetime ASC',
'size': 'fg.size ASC, LOWER(fg.primary_path) ASC',
'-size': 'fg.size DESC NULLS LAST, LOWER(fg.primary_path) DESC',
}

View file

@ -507,7 +507,7 @@ def test_get_channel_videos_pagination(test_client, test_session, simple_channel
]
last_ids = []
for offset, video_count in tests:
_, response = assert_video_search(channel_id=simple_channel.id, order_by='id', offset=offset, limit=20)
_, response = assert_video_search(channel_id=simple_channel.id, order_by='upload_date', offset=offset, limit=20)
assert len(response.json['file_groups']) == video_count, 'Returned videos does not match'
current_ids = [i['id'] for i in response.json['file_groups']]
assert current_ids != last_ids, f'IDs are unchanged current_ids={current_ids}'

View file

@ -42,8 +42,6 @@ VIDEO_ORDERS = {
'-upload_date': 'v.upload_date DESC NULLS LAST, LOWER(fg.primary_path) ASC',
'rank': '2 DESC, LOWER(fg.primary_path) DESC',
'-rank': '2 ASC, LOWER(fg.primary_path) ASC',
'id': 'fg.id ASC',
'-id': 'fg.id DESC',
'size': 'fg.size ASC, LOWER(fg.primary_path) ASC',
'-size': 'fg.size DESC, LOWER(fg.primary_path) DESC',
'duration': 'duration ASC, LOWER(fg.primary_path) ASC',