feat: add media viewers for images and videos#9
Conversation
- Reformat lockfile entries - Drop obsolete worker dependency entries
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9549d45be5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| }); | ||
| } | ||
|
|
||
| const { start, end } = parseSingleRange(rangeHeader, stat.size); |
There was a problem hiding this comment.
Close file handle before rejecting invalid video ranges
createInlineOriginalContentResponse opens the file before parsing Range, but parseSingleRange(...) can throw MediaContentError and exit before any stream is created, so the FileHandle is never closed on that path. Because FileHandle.createReadStream() only auto-closes when a stream exists, repeated malformed Range requests can leak descriptors until media reads start failing under load.
Useful? React with 👍 / 👎.
| const expiredFolderRoots = (await prisma.folder.findMany({ | ||
| where: { | ||
| deletedAt: { lte: cutoff }, | ||
| parentId: null, // Only top-level trashed roots |
There was a problem hiding this comment.
Find expired trash roots without requiring parentId null
The retention pass only selects expired folders with parentId: null, but normal trashed folders keep their original parent and are soft-deleted by timestamp, so this filter skips virtually all real trashed folder trees. As a result, Step 2 never purges folder records/descendants, leaving soft-deleted folder metadata behind indefinitely even after retention cutoff.
Useful? React with 👍 / 👎.
|
will look into this tmrw |
- Close file handles on invalid range errors - Skip retention for files in still-trashed child folders - Add coverage for streamed responses and trash revalidation
🚀 Summary
Replace the generated preview system with original-file viewers for images and videos across the private library and public shares. Add dedicated viewer/content routes with video range support, remove preview scheduling and FFmpeg-backed worker jobs, and update shared types, docs, and admin surfaces to use viewer semantics instead of preview state.
📊 Impacts and Changes
downloadDisabledis enabled; that setting only removes explicit download actions.viewerKindinstead.🧪 Testing Checklist
pnpm lintpassedpnpm testpassedpnpm buildsuccessfulReview Checklist
🧗 Follow-ups or Limitations
PDF, text, and audio viewer models are the next follow-up. See #8
🔗 Linked Issues
None