feat: web video transcoding, admin playback, and viewer fixes
CI / skip-ci-check (pull_request) Successful in 1m4s
CI / lint-and-type-check (pull_request) Has been cancelled
CI / python-lint (pull_request) Has been cancelled
CI / test-backend (pull_request) Has been cancelled
CI / build (pull_request) Has been cancelled
CI / secret-scanning (pull_request) Has been cancelled
CI / dependency-scan (pull_request) Has been cancelled
CI / sast-scan (pull_request) Has been cancelled
CI / workflow-summary (pull_request) Has been cancelled
CI / skip-ci-check (pull_request) Successful in 1m4s
CI / lint-and-type-check (pull_request) Has been cancelled
CI / python-lint (pull_request) Has been cancelled
CI / test-backend (pull_request) Has been cancelled
CI / build (pull_request) Has been cancelled
CI / secret-scanning (pull_request) Has been cancelled
CI / dependency-scan (pull_request) Has been cancelled
CI / sast-scan (pull_request) Has been cancelled
CI / workflow-summary (pull_request) Has been cancelled
Add on-demand H.264/AAC web playback (RQ, ffmpeg) with API routes and Next.js proxies; extend admin UI with WebPlaybackVideo and shared hooks. Store transcode cache beside pending-photos (WEB_VIDEO_CACHE_DIR / UPLOAD_DIR) and ignore data/web_videos. Centralize FastAPI URL helpers, optional Vite and Next base paths for subfolder deploy, and fix modal reopen by using router.replace when closing the home photo viewer. Include migration, install scripts, deployment doc updates, and CI admin build env tweak. Made-with: Cursor
This commit is contained in:
@@ -618,31 +618,26 @@ export function HomePageContent({ initialPhotos, people, tags }: HomePageContent
|
||||
|
||||
// Handle closing the modal
|
||||
const handleCloseModal = () => {
|
||||
// Set flag to prevent useEffect from running
|
||||
// Skip one modal effect run (avoids racing with stale params during close)
|
||||
isClosingModalRef.current = true;
|
||||
|
||||
|
||||
// Clear modal state immediately (no reload, instant close)
|
||||
setModalPhoto(null);
|
||||
setModalPhotos([]);
|
||||
setModalIndex(0);
|
||||
|
||||
// Update URL directly using history API to avoid triggering Next.js router effects
|
||||
// This prevents any reload or re-fetch when closing
|
||||
|
||||
// Must use Next.js router so useSearchParams() updates. Raw history.replaceState
|
||||
// leaves the router thinking ?photo=… is still active, so router.push for the same
|
||||
// photo is a no-op and the modal never reopens.
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
params.delete('photo');
|
||||
params.delete('photos');
|
||||
params.delete('index');
|
||||
params.delete('autoplay');
|
||||
|
||||
|
||||
const newUrl = params.toString() ? `/?${params.toString()}` : '/';
|
||||
// Use window.history directly to avoid Next.js router processing
|
||||
window.history.replaceState(
|
||||
{ ...window.history.state, as: newUrl, url: newUrl },
|
||||
'',
|
||||
newUrl
|
||||
);
|
||||
|
||||
// Reset flag after a short delay to allow effects to see it
|
||||
router.replace(newUrl, { scroll: false });
|
||||
|
||||
setTimeout(() => {
|
||||
isClosingModalRef.current = false;
|
||||
}, 100);
|
||||
|
||||
Reference in New Issue
Block a user