reboot alterflixhub
This commit is contained in:
commit
1e84023a44
188 files changed
+31629
No files matched your search
@@ -0,0 +1,238 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
"""เพิ่มโรงหนังชุดใหม่ (ข้อมูลพื้นฐาน) เข้า data/content/content.json"""
|
||||
import json
|
||||
|
||||
PATH = "data/content/content.json"
|
||||
|
||||
|
||||
def cinema(slug, name, name_th, tags, loc, loc_en, coords, desc, desc_en,
|
||||
map_url, addr, addr_en, transport, contacts):
|
||||
return {
|
||||
"slug": slug,
|
||||
"name": name,
|
||||
"name_th": name_th,
|
||||
"tags": tags,
|
||||
"location_label": loc,
|
||||
"location_label_en": loc_en,
|
||||
"coordinates": coords,
|
||||
"description": desc,
|
||||
"description_en": desc_en,
|
||||
"map_url": map_url,
|
||||
"address_lines": addr,
|
||||
"address_lines_en": addr_en,
|
||||
"transport": transport,
|
||||
"contacts": contacts,
|
||||
"payments": [],
|
||||
"photos": [],
|
||||
}
|
||||
|
||||
|
||||
NEW = [
|
||||
cinema(
|
||||
"doc-club-and-friends", "DOC CLUB & FRIENDS", "ด็อกคลับ แอนด์ เฟรนด์ส",
|
||||
["อาร์ตเฮาส์", "สารคดี", "หนังนอกกระแส"],
|
||||
"ชั้น 2 อาคาร Cloud 11 สุขุมวิท (BTS ปุณณวิถี) กรุงเทพฯ",
|
||||
"2nd floor, Cloud 11, Sukhumvit (BTS Punnawithi), Bangkok", None,
|
||||
"โรงหนังของ Doc Club & Friends ชั้น 2 อาคาร Cloud 11 ห้องขนาด 34 ที่นั่ง "
|
||||
"ฉายหนังสารคดีและหนังนอกกระแส มีบาร์และพื้นที่นั่งคุยกันหลังหนังจบ เปิดทุกวัน 11.00–24.00",
|
||||
"Doc Club & Friends' 34-seat screening room on the 2nd floor of Cloud 11 — "
|
||||
"documentaries and independent films, with a bar and a place to talk after the credits. Open daily 11.00–24.00.",
|
||||
"https://maps.google.com/?q=Doc+Club+%26+Friends+Cloud+11",
|
||||
["ชั้น 2 อาคาร Cloud 11", "888 ถนนสุขุมวิท แขวงพระโขนงใต้ เขตพระโขนง กรุงเทพฯ 10260"],
|
||||
["2nd floor, Cloud 11", "888 Sukhumvit Rd., Phra Khanong Tai, Phra Khanong, Bangkok 10260"],
|
||||
[{"icon_name": "metro", "value": "BTS สายสุขุมวิท ลงสถานีปุณณวิถี แล้วเดินเข้าห้าง Cloud 11",
|
||||
"value_en": "BTS Sukhumvit line, Punnawithi station — walk into Cloud 11"}],
|
||||
[{"label": "เว็บไซต์", "value": "docclubandfriends.com", "href": "https://docclubandfriends.com/"}],
|
||||
),
|
||||
cinema(
|
||||
"sala-saneha", "SALA SANEHA", "ศาลาเสน่หา",
|
||||
["อาร์ตเฮาส์", "หนังคลาสสิก"],
|
||||
"ซอยเดโช สีลม เขตบางรัก กรุงเทพฯ",
|
||||
"Soi Decho, Silom, Bang Rak, Bangkok", None,
|
||||
"โรงหนังอิสระและไวน์บาร์ในอาคารเก่าอายุกว่า 70 ปีกลางย่านสีลม ฉายหนังคัดสรรพร้อมพื้นที่นั่งเล่นและชั้นหนังสือ",
|
||||
"An independent cinema and wine bar inside a 70-year-old building in Silom — curated screenings with a lounge and a small library.",
|
||||
"https://maps.google.com/?q=Sala+Saneha+Silom+Bangkok",
|
||||
["ซอยเดโช (ถนนเดโช) แขวงสีลม เขตบางรัก กรุงเทพฯ"],
|
||||
["Soi Decho, Silom, Bang Rak, Bangkok"],
|
||||
[{"icon_name": "metro", "value": "BTS สถานีศาลาแดง หรือ MRT สถานีสีลม แล้วเดินเข้าซอยเดโช",
|
||||
"value_en": "BTS Sala Daeng or MRT Silom, then walk into Soi Decho"}],
|
||||
[],
|
||||
),
|
||||
cinema(
|
||||
"lido-connect", "LIDO CONNECT", "ลิโด้ คอนเน็กต์",
|
||||
["อาร์ตเฮาส์", "หนังนอกกระแส", "หนังคลาสสิก"],
|
||||
"สยามสแควร์ ถนนพระราม 1 ปทุมวัน กรุงเทพฯ",
|
||||
"Siam Square, Rama I Rd., Pathum Wan, Bangkok", None,
|
||||
"พื้นที่ฉายหนังและกิจกรรมกลางสยามสแควร์ ปรับปรุงจากโรงหนังลิโด้เดิม จัดฉายหนังนอกกระแส หนังคลาสสิก และอีเวนต์ตลอดปี",
|
||||
"A screening and event space in the middle of Siam Square, rebuilt from the original Lido cinema — indie and classic films plus events year round.",
|
||||
"https://maps.google.com/?q=Lido+Connect+Siam+Square",
|
||||
["258 ถนนพระราม 1 แขวงปทุมวัน เขตปทุมวัน กรุงเทพฯ 10330"],
|
||||
["258 Rama I Rd., Pathum Wan, Bangkok 10330"],
|
||||
[{"icon_name": "metro", "value": "BTS สถานีสยาม ทางออกสยามสแควร์",
|
||||
"value_en": "BTS Siam station, Siam Square exit"}],
|
||||
[{"label": "เว็บไซต์", "value": "lidoconnect.com", "href": "https://www.lidoconnect.com/"}],
|
||||
),
|
||||
cinema(
|
||||
"dech-udom-theatre", "เดชอุดมเธียเตอร์", "เดชอุดมเธียเตอร์",
|
||||
["หนังในกระแส"],
|
||||
"อำเภอเดชอุดม จังหวัดอุบลราชธานี",
|
||||
"Dech Udom, Ubon Ratchathani", None,
|
||||
"โรงภาพยนตร์เก่าในอำเภอเดชอุดม จังหวัดอุบลราชธานี — ยังต้องเติมรอบฉายและช่องทางติดต่อ",
|
||||
"An old cinema in Dech Udom district, Ubon Ratchathani — screen times and contacts still need to be added.",
|
||||
"https://maps.google.com/?q=Dech+Udom+Theatre+Ubon+Ratchathani",
|
||||
["อำเภอเดชอุดม จังหวัดอุบลราชธานี"],
|
||||
["Dech Udom district, Ubon Ratchathani"],
|
||||
[], [],
|
||||
),
|
||||
cinema(
|
||||
"muangthong-rama", "เมืองทองรามา", "เมืองทองรามา",
|
||||
["หนังในกระแส", "หนังคลาสสิก"],
|
||||
"อำเภอเมือง จังหวัดพะเยา",
|
||||
"Mueang district, Phayao", None,
|
||||
"โรงหนัง stand-alone ของจังหวัดพะเยา เปิดฉายตั้งแต่ปี 2518 เคยเป็นโรงหลักของเมือง "
|
||||
"ก่อนถูกมัลติเพล็กซ์แทนที่ และกลับมาฉายอีกครั้งโดยทายาทรุ่นลูก",
|
||||
"Phayao's stand-alone cinema, open since 1975. Once the town's main picture house, it lost ground to multiplexes and has been revived by the founder's children.",
|
||||
"https://maps.google.com/?q=Muangthong+Rama+Phayao",
|
||||
["อำเภอเมืองพะเยา จังหวัดพะเยา"],
|
||||
["Mueang district, Phayao"],
|
||||
[], [],
|
||||
),
|
||||
cinema(
|
||||
"phok-bookshop-cinema", "พก PHOK", "พก — ร้านหนังสือและโรงหนัง",
|
||||
["สารคดี", "หนังนอกกระแส"],
|
||||
"จังหวัดเชียงราย (เคลื่อนที่ ไม่มีหน้าร้าน)",
|
||||
"Chiang Rai (mobile, no fixed shop)", None,
|
||||
"ร้านหนังสือและโรงหนังสารคดีเคลื่อนที่ในรถตู้ เดินทางไปฉายหนังและขายหนังสือตามพื้นที่ต่าง ๆ ทั้งในและนอกจังหวัดเชียงราย",
|
||||
"A bookshop and documentary cinema in a van — travelling to screen films and sell books in and beyond Chiang Rai.",
|
||||
None,
|
||||
["จังหวัดเชียงราย (ไม่มีที่ตั้งถาวร — ดูประกาศรอบฉายจากเพจ)"],
|
||||
["Chiang Rai (no fixed address — check the page for upcoming screenings)"],
|
||||
[], [],
|
||||
),
|
||||
cinema(
|
||||
"wednesday-shine", "WEDNESDAY SHINE", "พุธฉาย",
|
||||
["อาร์ตเฮาส์", "หนังนอกกระแส"],
|
||||
"ถนนช้างเผือก ตำบลศรีภูมิ เมืองเชียงใหม่",
|
||||
"Chang Phueak Rd., Si Phum, Mueang Chiang Mai", None,
|
||||
"ไมโครซีนีมาในย่านช้างเผือก เชียงใหม่ จัดฉายหนังนอกกระแสและหนังสารคดีเป็นรอบ ๆ พร้อมกิจกรรมพูดคุยหลังหนังจบ",
|
||||
"A microcinema on Chang Phueak in Chiang Mai, screening independent and documentary films in rounds with post-screening talks.",
|
||||
"https://maps.google.com/?q=Wednesday+Shine+Chiang+Mai",
|
||||
["5/27 ถนนช้างเผือก ซอย 4 ง ตำบลศรีภูมิ อำเภอเมืองเชียงใหม่ จังหวัดเชียงใหม่"],
|
||||
["5/27 Chang Phueak Rd., Si Phum, Mueang Chiang Mai, Chiang Mai"],
|
||||
[],
|
||||
[{"label": "โทรศัพท์", "value": "081-854-6649", "href": "tel:+66818546649"}],
|
||||
),
|
||||
cinema(
|
||||
"mecani", "MECANI", "เมคานี",
|
||||
["อาร์ตเฮาส์", "หนังนอกกระแส", "หนังคลาสสิก"],
|
||||
"ตำบลดอนแก้ว อำเภอแม่ริม จังหวัดเชียงใหม่",
|
||||
"Don Kaeo, Mae Rim, Chiang Mai", None,
|
||||
"โรงหนังเล็ก 24 ที่นั่งในตำบลดอนแก้ว อำเภอแม่ริม ฉายหนังนอกกระแสและหนังเก่า ตั้งใจให้เป็นโรงหนังของคนในชุมชน",
|
||||
"A 24-seat house in Don Kaeo, Mae Rim, screening independent and older films — built to be the neighbourhood's own cinema.",
|
||||
"https://maps.google.com/?q=Mecani+Don+Kaeo+Mae+Rim+Chiang+Mai",
|
||||
["1380 ตำบลดอนแก้ว อำเภอแม่ริม จังหวัดเชียงใหม่"],
|
||||
["1380 Don Kaeo, Mae Rim, Chiang Mai"],
|
||||
[],
|
||||
[{"label": "โทรศัพท์", "value": "06 5989 8657", "href": "tel:+66659898657"}],
|
||||
),
|
||||
cinema(
|
||||
"kku-cinema", "โรงหนัง ม.ขอนแก่น", "โรงหนัง มหาวิทยาลัยขอนแก่น",
|
||||
["สารคดี", "หนังคลาสสิก", "หนังนอกกระแส"],
|
||||
"ศูนย์ศิลปวัฒนธรรม มหาวิทยาลัยขอนแก่น อำเภอเมือง จังหวัดขอนแก่น",
|
||||
"Cultural Center, Khon Kaen University, Mueang, Khon Kaen", None,
|
||||
"โรงภาพยนตร์ของหอภาพยนตร์อีสาน ศูนย์ศิลปวัฒนธรรม มหาวิทยาลัยขอนแก่น "
|
||||
"ฉายหนังคลาสสิก หนังสารคดี และหนังหาดูยาก และเปิดให้จองรอบฉาย",
|
||||
"The cinema of the Isan Film Archive at Khon Kaen University's Cultural Center — classic, documentary and rare films, with bookable screenings.",
|
||||
"https://maps.google.com/?q=Isan+Film+Archive+Khon+Kaen+University",
|
||||
["ศูนย์ศิลปวัฒนธรรม มหาวิทยาลัยขอนแก่น",
|
||||
"123 หมู่ 16 ตำบลศิลา อำเภอเมืองขอนแก่น จังหวัดขอนแก่น 40002"],
|
||||
["Cultural Center, Khon Kaen University", "123 Moo 16, Sila, Mueang Khon Kaen, Khon Kaen 40002"],
|
||||
[],
|
||||
[{"label": "โทรศัพท์", "value": "043-202-663", "href": "tel:+6643202663"}],
|
||||
),
|
||||
cinema(
|
||||
"mvp-cinema", "MVP CINEMA", "เอ็มวีพี",
|
||||
["หนังในกระแส"],
|
||||
"บุรีรัมย์ · กาฬสินธุ์ · เลย · ศรีสะเกษ",
|
||||
"Buriram · Kalasin · Loei · Sisaket", None,
|
||||
"เครือโรงภาพยนตร์ในภาคอีสาน 4 สาขา — บุรีรัมย์ กาฬสินธุ์ เลย และศรีสะเกษ เช็กรอบฉายรวมทุกสาขาได้ที่เว็บไซต์",
|
||||
"An Isan cinema chain with four branches — Buriram, Kalasin, Loei and Sisaket; showtimes for every branch are listed on its site.",
|
||||
"https://www.ilovemvp.com/",
|
||||
["สาขา บุรีรัมย์ / กาฬสินธุ์ / เลย / ศรีสะเกษ"],
|
||||
["Branches: Buriram / Kalasin / Loei / Sisaket"],
|
||||
[],
|
||||
[{"label": "เว็บไซต์", "value": "ilovemvp.com", "href": "https://www.ilovemvp.com/"}],
|
||||
),
|
||||
cinema(
|
||||
"nevada-multiplex", "NEVADA MULTIPLEX", "เนวาด้ามัลติเพล็กซ์",
|
||||
["หนังในกระแส"],
|
||||
"ถนนสุขเกษม อำเภอเมืองสกลนคร จังหวัดสกลนคร",
|
||||
"Suk Kasem Rd., Mueang Sakon Nakhon", None,
|
||||
"โรงภาพยนตร์มัลติเพล็กซ์ในอำเภอเมืองสกลนคร อยู่บนถนนสุขเกษมในย่านศูนย์การค้าของเมือง",
|
||||
"A multiplex in Mueang Sakon Nakhon on Suk Kasem Road, inside the town's shopping area.",
|
||||
"https://maps.google.com/?q=Nevada+Multiplex+Sakon+Nakhon",
|
||||
["ถนนสุขเกษม ตำบลดงมะไฟ อำเภอเมืองสกลนคร จังหวัดสกลนคร"],
|
||||
["Suk Kasem Rd., Dong Mafai, Mueang Sakon Nakhon, Sakon Nakhon"],
|
||||
[], [],
|
||||
),
|
||||
cinema(
|
||||
"suen-heng-multiplex-sisaket", "SUEN-HENG MULTIPLEX SISAKET", "ซุ่นเฮง มัลติเพล็กซ์ ศรีสะเกษ",
|
||||
["หนังในกระแส"],
|
||||
"ถนนวันลูกเสือ เทศบาลเมืองศรีสะเกษ จังหวัดศรีสะเกษ",
|
||||
"Wan Luksuea Rd., Mueang Sisaket", {"latitude": 15.1116618, "longitude": 104.3284349},
|
||||
"โรงภาพยนตร์มัลติเพล็กซ์ในศูนย์การค้าซุ่นเฮง ใจกลางเมืองศรีสะเกษ",
|
||||
"A multiplex inside the Suen Heng shopping centre in the middle of Sisaket town.",
|
||||
"https://maps.google.com/?q=Suen+Heng+Sisaket",
|
||||
["ศูนย์การค้าซุ่นเฮง ถนนวันลูกเสือ ตำบลน้ำคำ อำเภอเมืองศรีสะเกษ จังหวัดศรีสะเกษ 33000"],
|
||||
["Suen Heng Plaza, Wan Luksuea Rd., Nam Kham, Mueang Sisaket, Sisaket 33000"],
|
||||
[], [],
|
||||
),
|
||||
cinema(
|
||||
"homeflick", "HOMEFLICK", "โฮมฟลิก",
|
||||
["หนังนอกกระแส", "อาร์ตเฮาส์"],
|
||||
"อำเภอเมืองนครราชสีมา (โคราช)",
|
||||
"Mueang Nakhon Ratchasima (Korat)", None,
|
||||
"กลุ่มฉายหนังนอกกระแสในโคราช เริ่มฉายครั้งแรกปี 2556 และมีห้องฉายของตัวเอง จัดรอบฉายพร้อมเสวนาอย่างต่อเนื่อง",
|
||||
"A Korat screening collective that started in 2013, now running its own screening room with regular post-film talks.",
|
||||
None,
|
||||
["อำเภอเมืองนครราชสีมา จังหวัดนครราชสีมา"],
|
||||
["Mueang Nakhon Ratchasima, Nakhon Ratchasima"],
|
||||
[], [],
|
||||
),
|
||||
cinema(
|
||||
"loprama", "ลพรามา LOPRAMA", "ลพรามา",
|
||||
["หนังนอกกระแส", "สารคดี", "อาร์ตเฮาส์"],
|
||||
"อำเภอเมืองลพบุรี (ฉายตามสถานที่ในเมือง)",
|
||||
"Mueang Lopburi (pop-up venues in town)", None,
|
||||
"กลุ่มฉายหนังอิสระในลพบุรี ใช้ภาพยนตร์ขับเคลื่อนเมือง จัดฉายหนังนอกกระแส สารคดี และหนังหาดูยากตามสถานที่ต่าง ๆ เช่น คาเฟ่และแกลเลอรี",
|
||||
"A Lopburi independent screening collective using film to animate the town — indie, documentary and rare titles shown in cafes, galleries and other venues.",
|
||||
None,
|
||||
["อำเภอเมืองลพบุรี จังหวัดลพบุรี"],
|
||||
["Mueang Lopburi, Lopburi"],
|
||||
[], [],
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
def main():
|
||||
raw = open(PATH, encoding="utf-8").read()
|
||||
crlf = "\r\n" in raw
|
||||
store = json.loads(raw)
|
||||
have = {c["slug"] for c in store["cinemas"]}
|
||||
added = [c for c in NEW if c["slug"] not in have]
|
||||
store["cinemas"].extend(added)
|
||||
|
||||
out = json.dumps(store, ensure_ascii=False, indent=2)
|
||||
if crlf:
|
||||
out = out.replace("\n", "\r\n")
|
||||
with open(PATH, "w", encoding="utf-8", newline="") as fh:
|
||||
fh.write(out + ("\r\n" if crlf else "\n"))
|
||||
|
||||
print("added:", len(added), "/ total:", len(store["cinemas"]), "/ crlf:", crlf)
|
||||
for c in added:
|
||||
print(" -", c["slug"], "|", c["name_th"], "|", c["location_label"])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,35 @@
|
||||
import { spawnSync } from "node:child_process";
|
||||
|
||||
const branchKind = process.env.FUSION_BRANCH_KIND;
|
||||
|
||||
if (branchKind !== "feature") {
|
||||
if (branchKind !== "main") {
|
||||
console.warn(
|
||||
`Skipping database migrations because FUSION_BRANCH_KIND is ${branchKind ?? "unset"}`,
|
||||
);
|
||||
}
|
||||
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
if (!process.env.DATABASE_URL_UNPOOLED) {
|
||||
console.warn(
|
||||
"Skipping database migrations because DATABASE_URL_UNPOOLED is not set",
|
||||
);
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
const isWindows = process.platform === "win32";
|
||||
const pnpmCommand = isWindows ? "pnpm.cmd" : "pnpm";
|
||||
const result = spawnSync(pnpmCommand, ["run", "db:migrate"], {
|
||||
env: process.env,
|
||||
shell: isWindows,
|
||||
stdio: "inherit",
|
||||
});
|
||||
|
||||
if (result.error) {
|
||||
console.error(result.error.message);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
process.exit(result.status ?? 1);
|
||||
@@ -0,0 +1,53 @@
|
||||
import { realpathSync } from "node:fs";
|
||||
import { fileURLToPath, pathToFileURL } from "node:url";
|
||||
|
||||
import { closeDbExec, withMigrationRuntime } from "@agent-native/core/db";
|
||||
import { loadEnv } from "@agent-native/core/scripts";
|
||||
import {
|
||||
runAppReleaseMigrations,
|
||||
runFrameworkReleaseMigrations,
|
||||
} from "@agent-native/core/server";
|
||||
|
||||
loadEnv();
|
||||
|
||||
async function main(): Promise<void> {
|
||||
await withMigrationRuntime(async () => {
|
||||
await runFrameworkReleaseMigrations(null);
|
||||
await runAppReleaseMigrations();
|
||||
});
|
||||
}
|
||||
|
||||
// Guard: closeDbExec() below tears down the shared database pool, so this
|
||||
// script must run only as its own process (`pnpm migrate:production`). The
|
||||
// framework's action auto-discovery would otherwise mount it as a live route
|
||||
// and running the teardown in-process breaks every other request with "Cannot
|
||||
// use a pool after calling end on the pool." Throw instead of tearing down a
|
||||
// pool this process does not own.
|
||||
function isProcessEntrypoint(): boolean {
|
||||
const entry = process.argv[1];
|
||||
if (!entry) return false;
|
||||
try {
|
||||
return (
|
||||
pathToFileURL(realpathSync(entry)).href ===
|
||||
pathToFileURL(realpathSync(fileURLToPath(import.meta.url))).href
|
||||
);
|
||||
} catch {
|
||||
// coercion-ok: an unresolvable entry path is not this script, so the guard below throws.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isProcessEntrypoint()) {
|
||||
throw new Error(
|
||||
"scripts/migrate-production.ts must run as its own process " +
|
||||
"(pnpm migrate:production); it closes the shared database pool when it " +
|
||||
"finishes, so importing or invoking it in-process — e.g. via an " +
|
||||
"auto-discovered action route — would break every other request.",
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
await main();
|
||||
} finally {
|
||||
await closeDbExec();
|
||||
}
|
||||
Reference in new issue
Block a user