b1: api — /img/{id}?i=n gallery chain (mirrored file -> CDN 302 -> 404; i=0 legacy), payload n_photos + last_photo_idx on deck/list/listing/section rows, POST /api/swipe persists optional photo_idx

This commit is contained in:
Torres
2026-11-11 00:04:10 -04:00
parent 4ca4cacda0
commit 604b983a51
2 changed files with 89 additions and 22 deletions

View File

@@ -416,7 +416,8 @@ def close_section(conn, section, now, status='closed',
def section_items(conn, section):
return conn.execute(
"""SELECT l.*, s.action AS decision, si.slot, si.position
"""SELECT l.*, s.action AS decision, s.last_photo_idx AS last_photo_idx,
si.slot, si.position
FROM section_items si
JOIN listings l ON l.id = si.listing_id
LEFT JOIN swipes s ON s.listing_id = l.id