feat(video): upload and play videos in the trip file manager

The file manager (which already attaches files to a place/activity) now accepts video uploads up to the larger video cap — other types stay at the document limit — and the lightbox plays them with the Plyr player over the plain same-origin download URL, so cookie auth and HTTP Range both work. Videos are excluded from the offline blob prefetch so one clip can't evict a trip's documents.
This commit is contained in:
Maurice
2026-06-30 11:22:19 +02:00
committed by Maurice
parent 61ffdb553e
commit e986c9ab27
6 changed files with 52 additions and 16 deletions
+7 -1
View File
@@ -72,6 +72,12 @@ function isPhoto(file: TripFile): boolean {
return file.mime_type.startsWith('image/')
}
// Videos can be hundreds of MB — never prefetch them into the bounded offline
// blob cache, or a single clip would evict the trip's real documents (#823).
function isVideo(file: TripFile): boolean {
return file.mime_type.startsWith('video/')
}
// ── Core logic ────────────────────────────────────────────────────────────────
/** Fetch bundle + write all entities for one trip into Dexie. */
@@ -99,7 +105,7 @@ async function syncTrip(tripId: number): Promise<void> {
/** Cache non-photo file blobs for a trip. Fire-and-forget safe. */
async function cacheFilesForTrip(files: TripFile[]): Promise<void> {
const nonPhotos = files.filter(f => f.url && !isPhoto(f))
const nonPhotos = files.filter(f => f.url && !isPhoto(f) && !isVideo(f))
let cached = 0
for (const file of nonPhotos) {