From ae6f6f7f74fd4df7704f963d2f1fdd1f3100668f Mon Sep 17 00:00:00 2001
From: yyamashita <yyamashita@mosquit.one>
Date: Fri, 8 May 2026 03:50:45 +0900
Subject: Add capacity filter for live houses (~100 / 100~300 / 300~)

- Add capacity field to VenueMeta and all 17 scrapers (researched values)
- Add capacity column to venues table with auto-migration for existing DBs
- Add capacity_range filter to queryEvents (small/medium/large)
- Add capacity selector to FilterBar UI

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---
 app/routes/events._index.tsx | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'app/routes/events._index.tsx')

diff --git a/app/routes/events._index.tsx b/app/routes/events._index.tsx
index f2e1737..cb1a019 100644
--- a/app/routes/events._index.tsx
+++ b/app/routes/events._index.tsx
@@ -1,6 +1,6 @@
 import { useLoaderData, useSearchParams, Link } from "react-router";
 import type { Route } from "./+types/events._index";
-import { queryEvents, getVenues } from "~/lib/db.server";
+import { queryEvents, getVenues, type CapacityRange } from "~/lib/db.server";
 import EventCard from "~/components/EventCard";
 import EventListRow from "~/components/EventListRow";
 import FilterBar from "~/components/FilterBar";
@@ -23,11 +23,12 @@ export async function loader({ request }: Route.LoaderArgs) {
   const date_to = url.searchParams.get("date_to") ?? defaultTo;
   const venue_id = url.searchParams.get("venue_id") ?? undefined;
   const keyword = url.searchParams.get("keyword") ?? undefined;
+  const capacity_range = (url.searchParams.get("capacity_range") ?? undefined) as CapacityRange | undefined;
   const page = Math.max(1, parseInt(url.searchParams.get("page") ?? "1", 10));
   const limit = 30;
   const offset = (page - 1) * limit;
 
-  const events = queryEvents({ date_from, date_to, venue_id, keyword, limit, offset });
+  const events = queryEvents({ date_from, date_to, venue_id, keyword, capacity_range, limit, offset });
   const venues = getVenues();
 
   return { events, venues, page, hasMore: events.length === limit, date_from, date_to };
-- 
cgit v1.2.3

