diff --git a/metadex/db.py b/metadex/db.py index 34f7d57..5f5836b 100644 --- a/metadex/db.py +++ b/metadex/db.py @@ -460,11 +460,12 @@ def remove_all( if hostname is None: hostname = config.hostname + location_dir = location if location.endswith("/") else location + "/" selector = and_( metadex.c.hostname == hostname, or_( metadex.c.location == location, - metadex.c.location.startswith(location + "/", autoescape=True), + metadex.c.location.startswith(location_dir, autoescape=True), ), ) stmt = select(metadex.c.location).where(selector)