fix: image and ranking bugfix

This commit is contained in:
Stijnvandenbroek
2026-03-06 14:06:45 +00:00
parent da5a455c36
commit 8de47410ce
2 changed files with 17 additions and 77 deletions

View File

@@ -4,6 +4,7 @@ from fastapi import APIRouter, Depends
from sqlalchemy import text
from sqlalchemy.orm import Session
from app.config import settings
from app.database import get_db
from app.queries import LISTING_SELECT, row_to_listing
from app.schemas import RankingResponse
@@ -18,8 +19,14 @@ def get_rankings(
offset: int = 0,
db: Session = Depends(get_db),
):
"""Return listings ranked by ELO rating (highest first)."""
query = LISTING_SELECT
"""Return listings ranked by ELO rating (highest first).
Only listings in the stable sample (elo.sample_listings) are shown.
"""
query = LISTING_SELECT + f"""
INNER JOIN {settings.ELO_SCHEMA}.sample_listings s
ON l.global_id = s.global_id
"""
params: dict = {"limit": limit, "offset": offset}
if status and status != "all":