* 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>
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>
Allow to quickly query all the files from a specific mimetype like in
the ResetRenderedTexts command.
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
* Simplify migration by not moving the actual files and just updating
the DB
* Don't store the storageid in the preview table as it is not needed
* Start adding tests
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
The new oc_previews table is optimized for storing previews and should
decrease significantly the space taken by previews in the filecache
table.
This attend to reuse the IObjectStore abstraction over S3/Swift/Azure
but currently only support one single bucket configuration.
Signed-off-by: Carl Schwan <carl.schwan@nextclound.com>
Since this PR #52221 was implemented, the log file has been flooded with warnings stating, "Cached preview not found for file; generating a new preview." This appears to be more of an informational message rather than a warning. This PR will change it from warning to debug
Original PR
#52221
Signed-off-by: AndyXheli <andyxheli@gmail.com>
This allows to benefit from all the checks done by the preview API.
This also use the newly introduced `cacheResult` argument to limit disk usage.
Signed-off-by: Louis Chemineau <louis@chmn.me>
This allows callers to use the API without increasing the disk usage.
Example: blurhash generation, where we request a preview for all uploaded pictures, but don't want to necessarily store that preview.
Signed-off-by: Louis Chemineau <louis@chmn.me>
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>
getCachedPreview used to call `getFile`, and this calls `getDirectoryListing` (or underlying function that list directory) to find the file. This was done for every preview spec.
Now, this is done only once at the beginning of the loop, and the array is just iterated when needed to find the correct entry.
Signed-off-by: Glandos <bugs-github@antipoul.fr>
If the maximum preview generated gives some kind of invalid IImage, it's dimentions and filename can be set to zero.
And then later we do a division by zero to keep the aspect ratio of the previews.
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Make sure that when fetching the image from the cache we don't
accidentally fetch the cropped image just because it also start with
256-256
Signed-off-by: Carl Schwan <carl@carlschwan.eu>