home · contact · privacy
From /files path filtering, remove case sensitivity. master
authorChristian Heller <c.heller@plomlompom.de>
Fri, 29 Nov 2024 06:29:49 +0000 (07:29 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Fri, 29 Nov 2024 06:29:49 +0000 (07:29 +0100)
src/ytplom/misc.py

index 45d2c408391b1ada0835bab0cfa580fd6e9920ea..f875e40dbae65702d8c694d7c5079e4b68bb46ba 100644 (file)
@@ -393,6 +393,7 @@ class VideoFile(DbData):
 
     @property
     def size(self) -> float:
 
     @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)
         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)
     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(
         conn.commit_close()
         files.sort(key=lambda t: t.rel_path)
         self._send_rendered_template(