]> git.scottworley.com Git - paperdoorknob/commitdiff
image filenames: Drop ? and following query parameters
authorScott Worley <scottworley@scottworley.com>
Fri, 29 Dec 2023 06:46:59 +0000 (22:46 -0800)
committerScott Worley <scottworley@scottworley.com>
Fri, 29 Dec 2023 06:46:59 +0000 (22:46 -0800)
images.py

index 68a96964e2dd70d0ea57b7547481507337bfe538..7932091668d20a47c53c71e5ebcc49267818ee24 100644 (file)
--- a/images.py
+++ b/images.py
@@ -32,7 +32,7 @@ class DiskImageStore(ImageStore):
 
     def _filename(self, url: str) -> str:
         assert url not in self._images
-        base = os.path.basename(url).replace('%', '')
+        base = os.path.basename(url).replace('%', '').split('?')[0]
         if base not in self._filenames:
             return base
         stem, ext = os.path.splitext(base)