Commit Graph

20 Commits (jtr/fix-public-exceptions-http-codes)

Author SHA1 Message Date
Carl Schwan cb82a9ef04 refactor(preview): Cleanup a bit the public interface
* Remove old IProvider interface, it's been deprecated since 17.0.0 (8
  years)
* Add type hinting to the IPreview interface and mark it as consumeable
  only
* Remove unused arguments from GeneratorHelper

Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-10-09 17:41:13 +07:00
Carl Schwan bef3996c3e fix(preview): Make version column a string
And move it to a different table so that we don't have to pay the
storage cost when not using it (most of the times).

Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-10-08 14:07:06 +07:00
Carl Schwan bfc7d5dd9f feat(preview): Implement scanning for previews
This work similarly to the move preview job to migrate the previews to
the new DB table and also reuse some code.

So when we are finding files in appdata/preview, try adding them to the
oc_previews table and delete them from the oc_filecache table.

Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-10-06 13:37:15 +07:00
Carl Schwan bba9667882 perf(preview): Adapt BackgroundCleanupJob to new previews table
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-10-06 13:37:15 +07:00
provokateurin 9836e9b164
chore(deps): Update nextcloud/coding-standard to v1.3.1
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-09-19 14:21:20 +07:00
Côme Chilliet d76745553c
fix: Fix phpdoc wording
Co-authored-by: Anna <anna@nextcloud.com>
Signed-off-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
2024-09-13 16:01:55 +07:00
Thomas Citharel c2150bd079
feat: Add mimetype into BeforePreviewFetchedEvent event
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2024-09-10 14:05:06 +07:00
Daniel Kesselberg 8d3b99349d
docs: update docs for ocp events
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2024-07-23 21:42:01 +07:00
Andy Scherzinger dae7c159f7
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-24 13:11:22 +07:00
John Molakvoæ 28725c46a8
feat: redirect to the mime icon if no preview available
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
2023-08-17 18:56:38 +07:00
Daniel Kesselberg 440f882322
feat: add width, height, crop and mode to BeforePreviewFetchedEvent
user_usage_report keeps a counter for files read.

The app uses

- OC_Filesystem::read hook
- Event listener (the legacy one) for IPreview::EVENT

Request for previews do not trigger the hook, hence the additional event listener.
The thumbnails for a list or grid view should not count, so we need the width and height.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2023-06-23 16:27:35 +07:00
Julius Härtl 07e94eca6f
Emit typed event when preview is requested
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-10-27 14:31:33 +07:00
John Molakvoæ (skjnldsv) 215aef3cbd
Update php licenses
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-06-04 22:02:41 +07:00
Julius Härtl 45a474071e
Remove @package annotations from public namespace
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-08-26 16:59:40 +07:00
Christoph Wurst 5bf3d1bb38
Update license headers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-12-05 15:38:45 +07:00
Roeland Jago Douma 68748d4f85
Some php-cs fixes
* Order the imports
* No leading slash on imports
* Empty line before namespace
* One line per import
* Empty after imports
* Emmpty line at bottom of file

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-22 20:52:10 +07:00
Robin Appelman 5e082f8946
allow keeping multiple preview "versions" of the same file
The main use case here is storage provided versioning where we dont have
separate file ids for all the versions, by allowing a prefix for the
version we can store separate previews for all the versions.

Additionally, by keeping all the version previews in the same folder as the
"normal" previews they will be cleaned up properly when the file is deleted

Signed-off-by: Robin Appelman <robin@icewind.nl>
2019-07-08 22:04:16 +07:00
Robin Appelman 6150614374
Add new Provider interface for preview providers
the main difference is passing the `File` object to the provider
instead of a `View` + path

Old providers will still continue to work as before

Signed-off-by: Robin Appelman <robin@icewind.nl>
2019-06-17 14:09:09 +07:00
Joas Schilling ba87db3fcc
Fix others 2016-07-21 18:13:57 +07:00
Roeland Jago Douma 31f6d01606
Move \OCP\Preview to PSR-4 2016-05-18 18:22:34 +07:00