Split the DB requests in chunk of 1000 and use INNER JOIN instead of IN
as this is better supported on all DB.
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
* 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>
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>
* 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>
Prevent downloading entire movie files from remote storage (e.g., S3)
when the 'moov atom' is located at the end of the file.
Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
Fixes#35936.
When running `OC\Preview\BackgroundCleanupJob`, the main iteration loop
in `run()` expects a folder, however, `getOldPreviewLocations()`
currently does not filter by mimetype and therefore can yield a
non-folder entry which causes an Exception when constructing the Folder
impl.
Filtering for `httpd/unix-directory`, as `getNewPreviewLocations()`
already does, fixes this issue.
Signed-off-by: Dario Mehlich <d.mehlich@gmail.com>