From 832259ce48e095227e827eb122635f7eb60a4b25 Mon Sep 17 00:00:00 2001 From: spechter Date: Wed, 15 Nov 2023 05:06:51 +0100 Subject: [PATCH 01/21] Expanded sorting functionality (#589) * - Added duration and filesize as options in sorting menu on Home and ChannelId views - Added keys 'duration' and 'filesize' as valid parameters to sort by - Mapped 'duration' and 'filesize' to their corresponding es keys * Fixed spelling * Changed formatting to comply to maximum line length. * Locally running "deploy.sh validate" before committing --------- Co-authored-by: spechter --- tubearchivist/home/src/ta/users.py | 9 ++++++++- tubearchivist/home/templates/home/channel_id.html | 2 ++ tubearchivist/home/templates/home/home.html | 2 ++ tubearchivist/home/views.py | 2 ++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/tubearchivist/home/src/ta/users.py b/tubearchivist/home/src/ta/users.py index bb6a387..7181b3f 100644 --- a/tubearchivist/home/src/ta/users.py +++ b/tubearchivist/home/src/ta/users.py @@ -50,7 +50,14 @@ class UserConfig: VALID_STYLESHEETS = get_stylesheets() VALID_VIEW_STYLE = ["grid", "list"] VALID_SORT_ORDER = ["asc", "desc"] - VALID_SORT_BY = ["published", "downloaded", "views", "likes"] + VALID_SORT_BY = [ + "published", + "downloaded", + "views", + "likes", + "duration", + "filesize", + ] VALID_GRID_ITEMS = range(3, 8) def __init__(self, user_id: str): diff --git a/tubearchivist/home/templates/home/channel_id.html b/tubearchivist/home/templates/home/channel_id.html index c51fbd2..6c8b653 100644 --- a/tubearchivist/home/templates/home/channel_id.html +++ b/tubearchivist/home/templates/home/channel_id.html @@ -82,6 +82,8 @@ + +