Add cheapest-night date-range scan to the Travelodge finder
Deploy with Docker Compose / deploy (push) Successful in 52s
Deploy with Docker Compose / deploy (push) Successful in 52s
A second "Cheapest night" tab on /hotels scans every candidate check-in between two dates (filtered by weekday, 1-7 nights, up to ~3 months), keeps the N cheapest hotels per night, and prices TfL transport once per unique hotel so the whole range fits in the streaming window. Backend - travelodge.py: extract _shortlist/_make_row/_price_hotels/_apply_transport from run_search; add a 30-minute per-(location, dates, rooms) Travelodge result cache, a deadline on page fetches, and run_scan (parallel date fetches with per-date failure isolation, one TfL lookup per hotel). - main.py: HotelRequestBase shared by search and scan requests, HotelScanRequest with weekday/range validation, scan event models, _guarded slot wrapper, POST /hotels/scan/stream (NDJSON). - nginx: the streaming location now matches /py/hotels/(search|scan). Frontend - Split CheapHotels.vue into SingleStayPanel, CheapestNightPanel, SharedFields, HotelRows, a shared form composable, stream/format helpers and hotels-shared.css; shared fields keep their values across tabs. - Vite dev server proxies /py to the Python API. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01H5P3C1HbbEwLZEYsjwr7uV
This commit is contained in:
@@ -27,6 +27,11 @@ export default defineConfig({
|
||||
"/api": "http://localhost:8080",
|
||||
"/gitea": "http://localhost:3000",
|
||||
"/radio": "http://localhost:8000",
|
||||
// Python API: nginx strips the /py prefix in production, so do the same here.
|
||||
"/py": {
|
||||
target: "http://localhost:8000",
|
||||
rewrite: (path) => path.replace(/^\/py/, ""),
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user