From: Christian Heller Date: Fri, 29 Nov 2024 06:29:49 +0000 (+0100) Subject: From /files path filtering, remove case sensitivity. X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/decks/%7B%7Byoutube_prefix%7D%7D%7B%7Bvideo_id%7D%7D?a=commitdiff_plain;h=fd5e8dc9a9e7b843c1f2592833916b949db9c597;p=ytplom From /files path filtering, remove case sensitivity. --- 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(