From fd5e8dc9a9e7b843c1f2592833916b949db9c597 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Fri, 29 Nov 2024 07:29:49 +0100 Subject: [PATCH] From /files path filtering, remove case sensitivity. --- src/ytplom/misc.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ytplom/misc.py b/src/ytplom/misc.py index 45d2c40..f875e40 100644 --- a/src/ytplom/misc.py +++ b/src/ytplom/misc.py @@ -393,6 +393,7 @@ class VideoFile(DbData): @property def size(self) -> float: + """If file at .full_path, return its megabytes size, else -1.""" if not self.full_path.is_file(): return -1 return self.full_path.stat().st_size / (1024 * 1024) @@ -991,7 +992,8 @@ class TaskHandler(BaseHTTPRequestHandler): def _send_files_index(self, filter_: ParamsStr, show_absent: bool) -> None: conn = DbConnection() files = [f for f in VideoFile.get_all(conn) - if filter_ in str(f.rel_path) and (show_absent or f.present)] + if filter_.lower() in str(f.rel_path).lower() + and (show_absent or f.present)] conn.commit_close() files.sort(key=lambda t: t.rel_path) self._send_rendered_template( -- 2.30.2