feat(home): ชั้นกรองที่ 1 — ประเภทโรงหนัง (ท้องถิ่น / อินดี้ / กลุ่มคนฉายหนัง)

- แถบกรองสองชั้นในแถวเดียว: ทั้งหมด → 3 ประเภท │ ยอดนิยม → หมวดภาพยนตร์เดิม
- เก็บประเภทที่ฟิลด์เดี่ยว cinema.venue_type (ค่าเดียว) + hasVenue()/filterCinemas({ venue })
- ย้าย "กลุ่มคนฉายหนัง" จาก categories ขึ้นชั้น 1 (ไม่ให้ปุ่มซ้ำ) · tag ยังอยู่และยังค้นหาเจอ
- เลือกได้ทีละชั้น: กดประเภทล้างหมวด / กดหมวดล้างประเภท / ทั้งหมดล้างทั้งคู่
- ปิด popularity path เมื่อกรองด้วยประเภท (กันจัดอันดับข้ามประเภท)
- หลังบ้าน: ช่อง "ประเภทโรงหนัง" ในหมวดข้อมูลหลัก + sanitize เฉพาะค่าใน VENUE_TYPES
- i18n: messages.venues (TH/EN) · override ได้ผ่าน site.terms
- scripts/set-venue-types.mjs จัดประเภท 29 โรง (15 ท้องถิ่น / 11 อินดี้ / 3 กลุ่มคนฉายหนัง) พร้อมสำรอง content.json
- tests: hasVenue + filterCinemas (165 ผ่าน) · sw v2.0.5 · DESIGN/AGENTS/README/admin-guide/api อัปเดต
This commit is contained in:
Bkk1234 committed 2026-11-16 01:46:59 +07:00
1 parent 2e794cd365
commit 1932098a1d
15 files changed
+362 -26

No files matched your search

+4 -1
View File
@@ -9,7 +9,7 @@ import { mkdir, readFile, rename, writeFile } from "node:fs/promises";
import path from "node:path";
import { sanitizeArticleBlocks } from "@/lib/article";
import type { Cinema } from "@/lib/cinemas";
import { VENUE_TYPES, type Cinema, type VenueType } from "@/lib/cinemas";
import { contactHref } from "@/lib/contact-link";
import {
seedAbout,
@@ -142,6 +142,9 @@ export function sanitizeCinemas(input: unknown): Cinema[] {
facilities: sanitizeFacilities(raw.facilities),
facility_details: sanitizeFacilityDetails(raw.facility_details),
hidden: raw.hidden === true,
venue_type: VENUE_TYPES.includes(raw.venue_type as VenueType)
? (raw.venue_type as VenueType)
: null,
contact_heading: asString(raw.contact_heading),
photos: asStringList(raw.photos),
};