feat(url-preview): Optionally download audio/video files for url preview requests #1473

Merged
ginger merged 6 commits from trashpanda/continuwuity:trashpanda/url-preview-videos into main 2026-03-09 13:27:39 +00:00
Contributor

This pull request adds audio and video files to URL previews and downloads them, if they are present and the config option is enabled.

Pull request checklist:

  • This pull request targets the main branch, and the branch is named something other than
    main.
  • I have written an appropriate pull request title and my description is clear.
  • I understand I am responsible for the contents of this pull request.
  • I have followed the contributing guidelines:
This pull request adds audio and video files to URL previews and downloads them, if they are present and the config option is enabled. **Pull request checklist:** - [x] This pull request targets the `main` branch, and the branch is named something other than `main`. - [x] I have written an appropriate pull request title and my description is clear. - [x] I understand I am responsible for the contents of this pull request. - I have followed the [contributing guidelines][c1]: - [x] My contribution follows the [code style][c2], if applicable. - [x] I ran [pre-commit checks][c1pc] before opening/drafting this pull request. - [x] I have [tested my contribution][c1t] (or proof-read it for documentation-only changes) myself, if applicable. This includes ensuring code compiles. - [x] My commit messages follow the [commit message format][c1cm] and are descriptive. - [ ] I have written a [news fragment][n1] for this PR, if applicable<!--(can be done after hitting open!)-->. [c1]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md [c2]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/docs/development/code_style.mdx [c1pc]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md#pre-commit-checks [c1t]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md#running-tests-locally [c1cm]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md#commit-messages [n1]: https://towncrier.readthedocs.io/en/stable/tutorial.html#creating-news-fragments
Henry-Hiles requested changes 2026-02-28 15:14:59 +00:00
Dismissed
Henry-Hiles left a comment

Can we check file size against max_request_size before downloading? Just to stop someone sending, e.g. a 20gb video and filling up a servers disk space.

Can we check file size against `max_request_size` before downloading? Just to stop someone sending, e.g. a 20gb video and filling up a servers disk space.
trashpanda changed title from WIP: feat(url-preview): Optionally download audio/video files for url preview requests to feat(url-preview): Optionally download audio/video files for url preview requests 2026-03-02 03:40:08 +00:00
ginger force-pushed trashpanda/url-preview-videos from 5b712416c5
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 3m3s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 17m42s
to 01d6d6e3d8
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 4m22s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 38m41s
2026-03-04 14:51:26 +00:00
Compare
ginger approved these changes 2026-03-04 14:55:33 +00:00
@ -143,2 +143,4 @@
}
pub fn url_preview_allow_audio_video(&self) -> bool {
self.server.config.url_preview_allow_audio_video
Owner

I really need to remove all these functions from globals. problems for a future PR

I really need to remove all these functions from globals. problems for a future PR
Henry-Hiles left a comment

LGTM, but I don't really do rust so most of this is magic to me :3

LGTM, but I don't really do rust so most of this is magic to me :3
ginger merged commit da3fac8cb4 into main 2026-03-09 13:27:39 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
continuwuation/continuwuity!1473
No description provided.