feat(media): primary media storage, growth goals, retention and delivery tools
CI / build (push) Has been cancelled
CI / build (push) Has been cancelled
Event photos and videos are now stored only on the NFS/local share named in Settings -> Media storage. Uploads, photo editing, video processing and the per-event filing step refuse to run until that share is configured and writable, so nothing is silently written inside the container. Video originals, renditions, posters and sidecars share one folder on the share. Also adds volunteer growth goals with a mentor queue, an admin retention and storage sweep with a cron entry point, cached gallery thumbnails with per-folder ZIP downloads, a server-rendered booth-sheet PDF, and in-app confirm/release for every upcoming assignment. Service reminders now ignore the one-off event reminder rule, which had been queueing an extra bogus reminder for each published service. Generated with Codebuff 🤖 Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
@@ -21,6 +21,7 @@ import {
|
||||
storedNameForEventPhoto,
|
||||
} from "@/lib/event-photos";
|
||||
import { errorResponse, jsonResponse } from "@/lib/http";
|
||||
import { mediaStorage } from "@/lib/media-storage";
|
||||
import { uuidv7 } from "@/lib/uuid";
|
||||
|
||||
class PhotoTooLarge extends Error {}
|
||||
@@ -69,6 +70,11 @@ export const POST = async (
|
||||
return errorResponse(403, "you are not assigned to this event");
|
||||
}
|
||||
|
||||
// Photos are only ever written to the configured media storage share, so refuse
|
||||
// before reading a single byte when that destination is not ready.
|
||||
const storage = await mediaStorage();
|
||||
if (!storage.ok) return errorResponse(503, storage.message);
|
||||
|
||||
const suppliedName = req.nextUrl.searchParams.get("name");
|
||||
if (!suppliedName) return errorResponse(400, "a filename is required");
|
||||
const filename = sanitizePhotoFilename(suppliedName);
|
||||
@@ -88,7 +94,7 @@ export const POST = async (
|
||||
|
||||
const photoId = uuidv7();
|
||||
const storedName = storedNameForEventPhoto(id, photoId, filename);
|
||||
const destination = eventPhotoPath(storedName);
|
||||
const destination = eventPhotoPath(storage.root, storedName);
|
||||
await mkdir(path.dirname(destination), { recursive: true });
|
||||
|
||||
const hash = createHash("sha256");
|
||||
|
||||
Reference in New Issue
Block a user