Add upload previews #14
Labels
No labels
Area/API
Area/CLI
Area/Data Model
Area/Dependencies
Area/Deployment
Area/Documentation
Area/Downloading
Area/Mobile
Area/Teams
Area/UI
Area/Uploading
Area/Webhooks
Kind
Bug
Kind
Discussion
Kind
Feature
Kind
Security
Kind
Task
Kind
Testing
Priority
Critical
Priority
High
Priority/Low
Priority/Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
good first issue
help wanted
question
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
BlakeRain/parcel#14
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
It would be nice to add previews for uploads. This can be done in a worker process that receives notifications of new uploads and generates previews for this uploads. We can then include the preview in the upload view.
The preview generation worker should run in a separate task and have an MPSC queue on which it can receive notification of new uploads. The worker will then process all the preview generation. The worker can also periodically check to see if any uploads need to have a preview generated for them.
Generation of previews is a complex topic that is far beyond the scope of this little app. So I think I'll use some command line tools that can be installed into the Docker container alongside Parcel. These tools can be things like ImageMagick and Poppler.
Note: I don't think I need to worry about licensing, as this project itself is highly permissive, and I'm just going to be installing these dependencies in a Docker image.
To know how to generate a preview for a file we'll need a way of configuring the previewers. I think a JSON file in an
etcdirectory will suffice. The JSON file can provide a correspondence between a MIME type and a series of commands to execute to generate the preview.I'll need to ascertain the MIME type of an upload. There are a few crates that seem to do the job, but they appear to be either unmaintained or lacking matchers for common office formats. I think it might be easier to just use the
filecommand 😁