mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-17 10:15:27 -04:00
fix: archive browser model filter is suffix-only and drops matching models (#1709)
This commit is contained in:
@@ -618,7 +618,12 @@ def setup_session_routes(session_manager: SessionManager, config: dict, webhook_
|
||||
safe_search = search.replace('%', r'\%').replace('_', r'\_')
|
||||
q = q.filter(DbSession.name.ilike(f"%{safe_search}%", escape='\\'))
|
||||
if model:
|
||||
q = q.filter(DbSession.model.ilike(f"%{model}"))
|
||||
# Contains match (mirrors the name filter above). The old
|
||||
# f"%{model}" was a SUFFIX-only match, so filtering by "gpt-4"
|
||||
# dropped "gpt-4o" and over-matched on shared suffixes; it also
|
||||
# left LIKE wildcards in the user value unescaped.
|
||||
safe_model = model.replace('%', r'\%').replace('_', r'\_')
|
||||
q = q.filter(DbSession.model.ilike(f"%{safe_model}%", escape='\\'))
|
||||
total = q.count()
|
||||
sort_map = {
|
||||
"recent": DbSession.updated_at.desc(),
|
||||
|
||||
Reference in New Issue
Block a user